-
Notifications
You must be signed in to change notification settings - Fork 33
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
Feature Recommendation: Callback for raw push object after notification pressed #71
Comments
@jehartzog thanks for sharing this. I was wondering what was your final approach after all? Did you keep Also curious to know if you checked the in-app API such as inAppHandler and Iterable.inAppManager. |
@grifotv We simply went through all (hundreds) of our templates to remove the custom push payloads and place that data as query parameters in the We used the IAM features of the Iterable SDK extensively. The biggest surprise we hit was #92 which seems to be resolved now. We did not upgrade yet so didn't eval the fix. |
@jehartzog thanks for the quick response. Regarding your push notification callback workaround, could you please explain where you added this? Would it be the
|
@grifotv Yes, we used |
We are currently in the process of migrating our react native application to use this lib for all push notifications. We previously used the more general libs
react-native-push-notification v4.0.0
,@react-native-community/push-notification-ios v1.3.0
, andreact-native-firebase v5.6.0
. We used Iterable to actually send push notifications, but just processed the raw payload ourselves to get the routing & tracking we needed.So far the integration of this lib has been smooth, but we found one rather custom thing we had set up exposed a gap in the functionality of this (and the underlying iOS/Android) SDK.
Our Current Solution
We previously used the
Push Payload
field to add our custom JSON which told our app how to handle the push once the user pressed on it.Example
Why This Approach Broke with this SDK
We realized early on that we basically had custom-built a lot of the functionality this SDK provides. We did so a year ago, before this SDK was around. After this lib was released we noticed it would be better to use the OpenURL action, and just insert deep-links that we can use in our app, rather then continuing to use our custom approach.
However we were forced to do so by the fact what we see as two omissions in this SDK:
Here is an example of the kind of callback you'd expect, if you just want to have non-sdk code to have access to the entire push object.
I thought this was an omission in this
react-native
version, but I dug around the root ios-sdk and saw this wasn't the case. The notification object is processed, tracked, and passed to an action handler, but there's no option to pass the raw object down the client.Your docs really only mention the ability to read this payload using
IterableApi.lastPushPayload
in client code to poll for the last payload received, but this leaves out the important cases of if an app is backgrounded/foregrounded when a push is pressed. The client has no way to know a push came through, except perhaps by polling the above to see if there is a change (not an approach we tried or recommend).Our Workaround
We saw that we could get the 'callback' functionality we desired by using the
Open URL
action and hooking in there. But it did seem odd to use that there is apparently know way to know if apush
is pressed by the user unless it happens to have aopenURL
or other action attached to it.Our Recommendation
We were able to quickly work around this, and end up with a cleaner implementation that met our needs. However, I expect most
react-native
developers will expect an option to hook into the raw push object arrival to enable additional customization/processing if desired.The text was updated successfully, but these errors were encountered: