how to extract parameter from Branch.io deep link url getting via push notification from Locality's. in React native - react-native

I am using Branch.IO to generate deep links. Now the normal flow works perfectly. Opens the application on tapping the link from the mobile browser.
The problem is when I put the deep link URL in the payload of notification and tap on the notification. I will get deep link Url but what is the best way to redirect on particular screen based on url parameter in react native?. i am not getting parameter
i am sending notification via locality's
Thanks in advance.

You can send custom data in the payload of the notification, may be a notification type and use that type to show the desired screen on notification tap.
For how to send Custom data in payload please check:
Apple Push Notification with Sending Custom Data

Related

How can I control push notification ON/OFF according to conditions? in React Native

I am making a push notification feature using reactnative push notification.
If I create a channel according to the reactnative push notification official statement, I can control it only when I enter the notification category in the application information of the application.
Can I use the reactnative push notifictaion library to control when I create a component within the app like Youtubemusic (below Image) and implement the push setting ON OFF control function? It doesn't seem to be in the official documentation.
I'm trying to implement this feature within the app, but I'm curious about how it's implemented in practice!
i'm not using local notification just remote
Basically, you have 2 way to achieve this: on backend side or on frontend side.
Backend
Send to backend current state of toggle settings inside your app. When backend want to send push to client, it is internally checks state of this toggle and make a decision send or not.
Frontend
All your push notifications must be send as data only and with high priority (contentAvailable: true, priority: 'high').
After that, only mobile app will control showing of push notifications, because data only push not display anything, just trigger mobile app about new message.
So, when your frontend app receive new push message, it check current user settings and make decision display it or not.

How to make whatsapp perform actions on behalf of react-native application?

I am trying to integrate whatsapp in my react-native app. So far the resources that I have found only tell how to send a message or open whatsapp via Linkurl from react-native application. But I want to take a step further and perform action from whatsapp. Imagine like you trigger the notification and you select the Yes and No and that performs the respective actions I want to make similar functionality but on whatsapp. After a user perform certain activity from the react-native application I want to send notification on whatsapp and without opening the react-native application the user should be able to perform action. Is there a way I can achieve this functionality.
React Native/JS do not have support to 'whatsapp://' scheme.
The following Schemes Only:
mailto; //For Mailing
tel; //For Telephone
sms; //For SMS
http / https; //For Hyperlinks
You can use this method to send WhatsApp message direct to a number.
https://wa.me/<phone#>

selecting react native push notification

I am using react native and trying to add push notification.
My application need push notification because of chatting. I just need push notification to appear whenever the user receives chat message.
I've searched couple of libraries about push notification and found out firebase and react-native-push-notification.
Which one is proper library for this case and please tell me if there is other better way to solve this problem.
We're using invertase firebase notification library which is working so far better without any issues.
You'll get almost all the options which you needed for push notification customization like badges, etc.

Request ID is not available when App Launches after clicking Facebook notification

A Facebook app is setup with iOS native app enabled with bundle id and App Store Id of another app.
Following are possible in the current scenario.
1.Sending an app request to a friend,
2.The request badge appears in the friend's Facebook,
3. And clicking on the request launches my app.
This was the link i referred to implement this.
https://developers.facebook.com/docs/howtos/send-requests-using-ios-sdk/#protip3
I am supposed to get a NSURL from these functions
– application:openURL:sourceApplication:annotation:
OR
– application:handleOpenURL:
and the expected format is as follows.
fb[APP_ID]://authorize#expires_in=[ACCESS_TOKEN_EXPIRATION]
&access_token=[USER_ACCESS_TOKEN]
&target_url=https://apps.facebook.com/[APP_NAME_SPACE]/?request_ids=
[COMMA_SEPARATED_REQUESTIDs]&ref=notif&app_request_type=user_to_user
Here the request_ids contains The id of app request send, and which can be used to get the data attached to the App Request.
Now my issue is that, I am not getting the NSURL in expected form, instead I get the following format. So I am unable to find or use the request_ids.
fb[APP_ID]://authorize#expires_in=[ACCESS_TOKEN_EXPIRATION]
&access_token=[USER_ACCESS_TOKEN]
&target_url=https://apps.facebook.com/application.php?id=442634372448098

iOS 5 remote notification when launching app from dashboard

since iOS 5, notifications are no more intrusive as previous. This is nice, but it seems that users prefer to tap directly on app icon from the Dashboard instead of the (small) banner area or notification center.
In such case, my app cannot get payload from notifications.. Even the 'application didReceiveRemoteNotification' method is not able to get the notification.
Has anyone got the same issue? Do you have any advice?
Thanks
The intention of the push payload is just to display something useful/informative to the user in the alert. Not to actually send data to your app.
So you will need your own web service to provide the data your app needs. Your app should refresh/sync to that service when it launches to get the data.
Example: Instagram. It can push notify you that someone commented on your photo. But it's not actually sending the comment data in the push to display in the app. The comment data is downloaded when you launch Instagram and attempt to view the comment.