@founderroute/analytics-react-native 1.0.0-rc.1 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -129,7 +129,7 @@ class FounderRouteAnalytics private constructor(private val context: Context, pr
|
|
|
129
129
|
private fun enqueue(name:String,kind:String,properties:JSONObject,extra:JSONObject=JSONObject(),outcomeId:String?=null) {
|
|
130
130
|
if(!consent||!permitted.get()||anonymousId==null)return
|
|
131
131
|
val now=System.currentTimeMillis();if(now-lastActivity>=1800000)session=UUID.randomUUID().toString();lastActivity=now
|
|
132
|
-
val ctx=JSONObject().put("sdk","android").put("sdk_version","1.0.0-rc.
|
|
132
|
+
val ctx=JSONObject().put("sdk","android").put("sdk_version","1.0.0-rc.2").put("app_id",appId);extra.keys().forEach { ctx.put(it,extra.get(it)) }
|
|
133
133
|
verificationId?.let{ctx.put("verification_id",it)}
|
|
134
134
|
campaign.keys().forEach { ctx.put(it,campaign.get(it)) }
|
|
135
135
|
val event=JSONObject().put("event_id",UUID.randomUUID().toString()).put("protocol",2).put("name",name).put("kind",kind).put("occurred_at",timestamp(now)).put("anonymous_id",anonymousId).put("session_id",session).put("collection_mode",collectionMode).put("consent_state",if(consentState=="granted")"granted" else "not_provided").put("properties",sanitize(properties,allowedProperties)).put("traits",sanitize(traits,allowedTraits)).put("context",ctx)
|
|
@@ -174,7 +174,7 @@ public final class FounderRouteAnalytics: @unchecked Sendable {
|
|
|
174
174
|
private func enqueue(_ name: String, kind: String, properties: [String: Any], context: [String: Any] = [:], outcomeId: String? = nil) {
|
|
175
175
|
guard consent, !stopped, let anonymousId else { return }
|
|
176
176
|
let now = Date(); if now.timeIntervalSince(lastActivity) >= 1800 { sessionId = UUID().uuidString }; lastActivity = now
|
|
177
|
-
var ctx: [String: Any] = ["sdk": "ios", "sdk_version": "1.0.0-rc.
|
|
177
|
+
var ctx: [String: Any] = ["sdk": "ios", "sdk_version": "1.0.0-rc.2", "app_id": appId]
|
|
178
178
|
ctx["verification_id"] = verificationId
|
|
179
179
|
for (key, value) in campaign { ctx[key] = value }
|
|
180
180
|
for (key, value) in context { ctx[key] = value }
|