Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to put device token #881

Closed
wants to merge 1 commit into from
Closed

Add method to put device token #881

wants to merge 1 commit into from

Conversation

wkunert
Copy link

@wkunert wkunert commented Apr 28, 2020

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
Copy link

bteng22 commented Jul 29, 2020

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
Copy link
Author

wkunert commented Jul 30, 2020

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
Copy link

harrigee commented Aug 18, 2020

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

@bsneed
Copy link
Contributor

bsneed commented Mar 18, 2021

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