urbanairship / react-native-airship

Airship React Native module
Other
86 stars 62 forks source link

How to create App Screens with Expo-Router? #539

Closed idrakimuhamad closed 8 months ago

idrakimuhamad commented 9 months ago

Hi. I'm using Airship with Expo-Router, and trying to create the app-screens in the Airship portal. As i'm using expo-router, I'm having difficulty to grab the "uniqueID" or the screen name, as expo-router seems to predefined the screen name based on the files created.

Expo-router https://docs.expo.dev/router/introduction/

Airship's app screen https://docs.airship.com/guides/messaging/user-guide/in-app-experiences/configuration/app-screens/#adding-an-app-screen-to-your-project

Do you have any guide to this use case?

rlepinski commented 8 months ago

@idrakimuhamad Sorry about missing this issue before it must of been lost in the holiday time off shuffle. Did you actually get it resolved or did you just give up on us?

idrakimuhamad commented 8 months ago

@idrakimuhamad Sorry about missing this issue before it must of been lost in the holiday time off shuffle. Did you actually get it resolved or did you just give up on us?

😂

I've actually contacted your support team about this and they mentioned that I must call the analytics module with the screen name for this to work. Is that correct?

rlepinski commented 8 months ago

Yeah, you need to manually call through to Airship since we do not want to make any assumptions on the screen being tracked since apps can be built differently. https://docs.airship.com/platform/mobile/analytics/?groupid=react-native#screen-tracking

Airship.analytics.trackScreen("MainScreen");
idrakimuhamad commented 8 months ago

Great. I will try it on then. Thanks!