Add method to put device token - #881
Conversation
|
Thanks for putting up the PR @nutlike 👍 Our team needs the same functionality. Do we just need to resolve these conflicts to get this merged in? |
|
As far as I understood this PR won‘t get merged, see segmentio/analytics-react-native#170 (comment): I still didn‘t find the time to look into the other options mentioned (and I believe there have been quite some changes to the SDKs since I opened this PR) – as soon as I have another solution I will post it here. |
|
We also need this functionality. Till this is fixed we are forced to skip segment and use customer.io directly. |
|
Closing this. Further investigation shows neither this solution or middleware are necessary. Simply calling registeredForRemoteNotificationsWithDeviceToken: will do the trick and device.token will be set even if you don't need a full-on push notification setup. Segment doesn't care what the value is, we just throw it in the payload as requested. |
What does this PR do?
This PR adds a method to put device tokens which are utilized by some destinations (e.g. Customer.io). The Segment Android SDK offers the same functionality. Setting device tokens (obtained from Firebase Cloud Messaging SDK) enables Customer.io to track devices via Segment which enables their push notification feature.
How should this be manually tested?
Call
[SEGAnalytics.sharedAnalytics putDeviceToken:@"i-am-a-device-token"]and check in Segment’s event debugger if new events contain thetokenkey within theircontext/devicedictionary.Any background context you want to provide?
We are developing in React Native and are using Firebase Cloud Messaging (via React Native Firebase). We want to use Customer.io to send out push notifications, so we are working on a pull request for the Segment React Native SDK to add functionality which is required to make this happen. Before we can continue our work we need a way to set a FCM device token in iOS – hence this pull request.
What are the relevant tickets?
#869
Questions:
I added comments, but the Segment website (Analytics for iOS) might also need one.
I don't think so.
Maybe?