You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,13 +78,18 @@ use SecureNative\sdk\SecureNativeOptions;
78
78
use SecureNative\sdk\EventTypes;
79
79
use SecureNative\sdk\SecureNativeContext;
80
80
81
-
82
-
$token = "[SECURED_CLIENT_TOKEN]";
83
-
$ctx = new SecureNativeContext($token, "79.179.88.157", null, (object)["user-agent" => "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us"], null, null, null);
81
+
$clientToken = "SECURED_CLIENT_TOKEN"
82
+
$headers = (object)["user-agent" => "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us"] // User-Agent header is important to get device information!
83
+
$ip = "127.0.0.1"
84
+
$remoteIp = "127.0.0.1"
85
+
$url = null
86
+
$method = null
87
+
$body = null
88
+
$ctx = new SecureNativeContext($clientToken, $ip, $remoteIp, $headers, $url, $method, $body);
84
89
85
90
SecureNative::track(array(
86
91
'event' => EventTypes::LOG_IN,
87
-
'context' => ctx,
92
+
'context' => $ctx,
88
93
'userId' => '1234',
89
94
'userTraits' => (object)[
90
95
'name' => 'Your Name',
@@ -159,17 +164,17 @@ use SecureNative\sdk\SecureNativeContext;
0 commit comments