Skip to content

How to get device token on an Expo React Native app #524

@cdedreuille

Description

@cdedreuille
  • analytics-react-native version: 2.1.11
  • React Native version: 0.68
  • iOS or Android or both? iOS

I have an Expo app suing the latest SDK45 with React Native 0.68.
I'm creating the client like this:

const client = createClient({
  writeKey: /* my key */,
  debug: false,
  trackAppLifecycleEvents: true,
  trackDeepLinks: true,
});

By using trackAppLifecycleEvents: true it automatically track lifecycle events like Application Opened.
To connect with customer.io I need to get context.device.token but I couldn't find how to set it up.

I saw this discussion but it seems that the middleware is for Android version.

Any idea how I could get the device token on a managed Expo app?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions