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
Web | Segment | [analytics.js-integrations](https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/moengage){:target="_blank"}
23
23
@@ -79,56 +79,49 @@ analytics.reset();
79
79
## iOS
80
80
81
81
82
-
To get started with MoEngage on iOS, first integrate your app with the [MoEngage-Segment-iOS](https://github.com/moengage/MoEngage-Segment-iOS){:target="_blank"} library. You can integrate MoEngage and Segment with [CocoaPods](http://cocoapods.org){:target="_blank"} or with Swift Package Manager.
83
-
84
-
* Initialize pod with pod init command, this will create a podfile for your project.
85
-
* Update your podfile by adding pod '**Segment-MoEngage**' as shown below:
86
-
87
-
```ruby
88
-
use_frameworks!
89
-
pod 'Segment-MoEngage'
90
-
```
91
-
92
-
* Update the pod.
93
-
94
-
pod update
82
+
To get started with MoEngage on iOS, first integrate your app with the [MoEngage-Segment-Swift](https://github.com/moengage/MoEngage-Segment-Swift){:target="_blank"} library. You can integrate MoEngage and Segment with Swift Package Manager.
95
83
84
+
> info ""
85
+
> **Note:** This document covers the integration with [analytics-swift](https://github.com/segmentio/analytics-swift){:target="_blank"}, if you have integrated with [analytics-ios](https://github.com/segmentio/analytics-ios){:target="_blank"} refer [this documentation](https://partners.moengage.com/hc/en-us/articles/4409143473172-iOS-device-mode-){:target="_blank"} for details on how to integrate.
96
86
97
-
To install with SPM use the [MoEngage-Segment-iOS](https://github.com/moengage/MoEngage-Segment-iOS.git){:target="_blank"} library and set the branch as master or version as 7.0.0 and above.
87
+
To install with SPM use the [MoEngage-Segment-Swift](https://github.com/moengage/MoEngage-Segment-Swift.git){:target="_blank"} library and set the branch as master or version as 1.0.0 and above.
98
88
99
89
### Configure the Segment SDK:
100
90
101
-
Navigate to the App Delegate file, and setup the Segment SDK:
102
-
1. Import `SEGMoEngageIntegrationFactory.h` and `SEGMoEngageInitializer.h`.
103
-
2. Initialize `MOSDKConfig` object and call `initializeDefaultInstance:` method of `SEGMoEngageInitializer`.
104
-
3. Initialize `SEGMoEngageIntegrationFactory` instance to the `SEGAnalyticsConfiguration` as shown below:
Under your Analytics-Swift library setup, add the MoEngage plugin using the `analytics.add(plugin: ...)` method. The MoEngage dashboard now tracks all of your events.
119
97
120
-
// Add MoEngageIntegrationFactory. Without this data will not come to MoEngage.
[User attributes](https://developers.moengage.com/hc/en-us/articles/4403905883796-Tracking-user-attributes){:target="_blank"} are specific traits of a user, like email, username, mobile, gender etc. **identify** lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about them.
Read more about [identify calls](/docs/connections/sources/catalog/libraries/mobile/ios/#identify).
@@ -138,8 +131,8 @@ Read more about [identify calls](/docs/connections/sources/catalog/libraries/mob
138
131
139
132
Segment uses event tracking to track user behavior in an app. `track` calls let you record the actions your users perform. Every action triggers an "event", which can also have associated attributes.
140
133
141
-
```objc
142
-
[[SEGAnalytics sharedAnalytics] track:@"Item Purchased" properties:@{ @"item": @"Sword of Heracles"}];
134
+
```swift
135
+
Analytics.main.track("Item Purchased",properties: @["item":"Sword of Heracles"])
143
136
```
144
137
145
138
Read more about [track calls](/docs/connections/sources/catalog/libraries/mobile/ios/#track).
@@ -149,8 +142,8 @@ Read more about [track calls](/docs/connections/sources/catalog/libraries/mobile
149
142
150
143
The `reset` method clears the SDK's internal stores for the current user. This is useful for apps where users can log in and out with different identities over time.
151
144
152
-
```objc
153
-
[[SEGAnalytics sharedAnalytics] reset];
145
+
```swift
146
+
Analytics.main.reset()
154
147
```
155
148
156
149
Read more about the [reset method](/docs/connections/sources/catalog/libraries/mobile/ios/#reset).
@@ -161,12 +154,12 @@ Read more about the [reset method](/docs/connections/sources/catalog/libraries/m
161
154
Since your app might already be on the App Store, you must specify whether your app update would be an `UPDATE` or an `INSTALL`.
162
155
To differentiate between those, use one of the method below:
Read more on [install/update differentiation](https://developers.moengage.com/hc/en-us/articles/4403910297620){:target="_blank"}.
@@ -184,21 +177,24 @@ Push Notifications are a great way to keep your users engaged and informed about
184
177
185
178
**Segment Push Implementation:**
186
179
187
-
1. Follow the directions to register for push notifications [with the Segment SDK](/docs/connections/sources/catalog/libraries/mobile/ios/#how-do-i-use-push-notifications).
180
+
1. In your application's application:didRegisterForRemoteNotificationsWithDeviceToken: method, add the following:
To enable the full functionality of MoEngage (like Push Notifications, InApp Messaging), complete the following steps in your Android app.
230
226
227
+
> info ""
228
+
> **Note:** This document covers the integration with [analytics-kotlin](https://github.com/segmentio/analytics-kotlin){:target="_blank"}, if you have integrated with [analytics-android](https://github.com/segmentio/analytics-android){:target="_blank"} refer [this documentation](https://partners.moengage.com/hc/en-us/articles/4409143473172-iOS-device-mode-){:target="_blank"} for details on how to integrate.
229
+
231
230
### Adding the MoEngage Dependency
232
231
233
232
Along with the Segment dependency, add the below dependency in your `build.gradle` file.
@@ -274,12 +272,12 @@ Copy the APP ID from the Settings Page `Dashboard --> Settings --> App --> Gener
274
272
> info ""
275
273
> **Note:** MoEngage recommend that you initialize the SDK on the main thread inside `onCreate()` and not create a worker thread and initialize the SDK on that thread.
276
274
277
-
```java
278
-
// this is the instance of the application class and "XXXXXXXXXXX" is the APP ID from the dashboard.
Please make sure token is passed to MoEngage SDK whenever push token is refreshed and on application update. Passing token on application update is important for migration to the MoEngage Platform.
@@ -372,12 +375,12 @@ Please make sure token is passed to MoEngage SDK whenever push token is refreshe
372
375
To pass the push payload to the MoEngage SDK call the MoEngage API from the `onMessageReceived()` from the Firebase receiver.
373
376
Before passing the payload to the MoEngage SDK you should check if the payload is from the MoEngage platform using the helper API provided by the SDK.
374
377
375
-
```java
376
-
if (MoEPushHelper.getInstance().isFromMoEngagePlatform(remoteMessage.getData())) {
0 commit comments