Skip to content

Add method to put device token - #881

Closed
wkunert wants to merge 1 commit into
segmentio:masterfrom
joinregimen:device-token
Closed

Add method to put device token#881
wkunert wants to merge 1 commit into
segmentio:masterfrom
joinregimen:device-token

Conversation

@wkunert

@wkunert wkunert commented Apr 28, 2020

Copy link
Copy Markdown

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 the token key within their context/device dictionary.

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:

  • Does the docs need an update?
    I added comments, but the Segment website (Analytics for iOS) might also need one.
  • Are there any security concerns?
    I don't think so.
  • Do we need to update engineering / success?
    Maybe?

@bteng22

bteng22 commented Jul 29, 2020

Copy link
Copy Markdown

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?

@wkunert

wkunert commented Jul 30, 2020

Copy link
Copy Markdown
Author

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.

@harrigee

harrigee commented Aug 18, 2020

Copy link
Copy Markdown

We also need this functionality. Till this is fixed we are forced to skip segment and use customer.io directly.

@bsneed

bsneed commented Mar 18, 2021

Copy link
Copy Markdown
Contributor

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.

@bsneed bsneed closed this Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants