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

Future seamless integration plans #103

Closed
niklavsBariss opened this issue Feb 14, 2024 · 13 comments · Fixed by #98
Closed

Future seamless integration plans #103

niklavsBariss opened this issue Feb 14, 2024 · 13 comments · Fixed by #98
Labels
enhancement New feature or request

Comments

@niklavsBariss
Copy link

niklavsBariss commented Feb 14, 2024

We are about to integrate Klaviyo in our React Native project for notifications and I'm wondering if you are planing on supporting initialising, setup and collecting push tokens without so much native code from users(of this package) perspective - just react-native layer

Klaviyo.initialize()
Klaviyo.getNotificationPermission()
Klaviyo.setPushToken()

Would be helpful to have in js

@niklavsBariss niklavsBariss added the enhancement New feature or request label Feb 14, 2024
@niklavsBariss
Copy link
Author

I'm just wondering about the planned timeline of #65 and #69

@niklavsBariss
Copy link
Author

Excuse my eagerness - I just realised #98 is in progress. Feel free to close this

@mTdev1
Copy link

mTdev1 commented Feb 14, 2024

Also waiting on #98. Hopefully it will be released soon.

@youcefswoo
Copy link

Also, a way to switch between subscribing and unsubscribing Mobile Push Notification for the current profile in the React Native layer ?
image

image

@evan-masseau
Copy link
Contributor

Thanks for getting in touch! As you already discovered, we are hard at work expanding upon our MVP to bridge initialize and setPushToken into the RN layer. Adding permission requesting to our SDK is not yet scoped. From feedback so far, we anticipate many customers to be using third party libraries for permissions and cross-platform push already. We’d be happy to hear additional feedback from you about your app setup!
I’ll keep you posted about #98, we’re doing our due diligence to test it out and draft readme updates. Of course if you want a sneak peak, you can npm install it with the latest commit hash for that branch. I’d welcome early feedback. Just be aware we haven’t completed testing it ourselves!

@evan-masseau
Copy link
Contributor

Also, a way to switch between subscribing and unsubscribing Mobile Push Notification for the current profile in the React Native layer

An actual unsubscribe function is coming, needs to be added to the native SDKs first. We fielded a similar question in the android repo here: klaviyo/klaviyo-android-sdk#106. The current, imperfect recommendation is for the user to control their push notifications by enabling or disabling the notification permission.

@youcefswoo
Copy link

youcefswoo commented Feb 14, 2024

Also, a way to switch between subscribing and unsubscribing Mobile Push Notification for the current profile in the React Native layer

An actual unsubscribe function is coming, needs to be added to the native SDKs first. We fielded a similar question in the android repo here: klaviyo/klaviyo-android-sdk#106. The current, imperfect recommendation is for the user to control their push notifications by enabling or disabling the notification permission.

My scenario is that I don't want the notification popup to appear at the start of the application. Instead, within the React Native side, when the user allows notification permission, the Klaviyo profile always remains unsubscribed.

@ajaysubra
Copy link
Collaborator

Also, a way to switch between subscribing and unsubscribing Mobile Push Notification for the current profile in the React Native layer

An actual unsubscribe function is coming, needs to be added to the native SDKs first. We fielded a similar question in the android repo here: klaviyo/klaviyo-android-sdk#106. The current, imperfect recommendation is for the user to control their push notifications by enabling or disabling the notification permission.

My scenario is that I don't want the notification popup to appear at the start of the application. Instead, within the React Native side, when the user allows notification permission, the Klaviyo profile always remains unsubscribed.

@youcefswoo we are aware of this limitation and are working to find a solution, in the mean time to workaround the issue, if in your iOS AppDelegate's didFinishLaunchingWithOptions you call registerForRemoteNotifications and you've implemented didRegisterForRemoteNotificationsWithDeviceToken delegate something like this the push enablement status will refresh. We also have an enhancement task in our backlog for our native SDKs to refresh the push enablement status on their own without requiring developers to do the above. When we do that we'll bridge it over to reach native to simplify this workflow.

@youcefswoo
Copy link

youcefswoo commented Feb 14, 2024

Also, a way to switch between subscribing and unsubscribing Mobile Push Notification for the current profile in the React Native layer

An actual unsubscribe function is coming, needs to be added to the native SDKs first. We fielded a similar question in the android repo here: klaviyo/klaviyo-android-sdk#106. The current, imperfect recommendation is for the user to control their push notifications by enabling or disabling the notification permission.

My scenario is that I don't want the notification popup to appear at the start of the application. Instead, within the React Native side, when the user allows notification permission, the Klaviyo profile always remains unsubscribed.

@youcefswoo we are aware of this limitation and are working to find a solution, in the mean time to workaround the issue, if in your iOS AppDelegate's didFinishLaunchingWithOptions you call registerForRemoteNotifications and you've implemented didRegisterForRemoteNotificationsWithDeviceToken delegate something like this the push enablement status will refresh. We also have an enhancement task in our backlog for our native SDKs to refresh the push enablement status on their own without requiring developers to do the above. When we do that we'll bridge it over to reach native to simplify this workflow.

and for Android ?

@evan-masseau
Copy link
Contributor

Likewise on android we're implementing an internal solution to more closely track push permission changes. But if you follow the instructions in the readme about collecting push tokens, then just like ajay explained for iOS the enablement status will be refreshed on app open, whenever Klaviyo.setPushToken is invoked.

@evan-masseau
Copy link
Contributor

If you've been watching #98 closely, you'll see it has been merged. We are just updating the example app and documentation and anticipate its release soon. Thanks

@ajaysubra ajaysubra linked a pull request Feb 22, 2024 that will close this issue
3 tasks
@ajaysubra
Copy link
Collaborator

@niklavsBariss as @evan-masseau mentioned above we should have a release 0.2.0 soon that should solve two of your requests I.E bridging initialize and setToken. For getNotificationPermission we found certain libraries like @react-native-firebase/messaging provide utility methods for doing this and we didn't feel like it's specific enough to a Klaviyo use case that made sense to bridge. Further, in order to set token from react native, one such library is required anyways to get the APNs token over to the react native layer. So we felt it made sense for developers to leverage that instead of us adding a bridge over to this functionality. If you still feel strongly about this, please open a discussion and we can look into it more.

Please keep an eye out for that release. Closing this out now and appreciate the feedback. Thanks!

@evan-masseau
Copy link
Contributor

Hi folks, our first release supporting initialize and setPushToken from react native has just gone out: v0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants