How we can use multiple click_action in firebase API fcm notifications?
for example:
{
"notification": {
"title" : "title",
"body" : "body text",
"icon" : "ic_notification",
**"click_action" : "OPEN_ACTIVITY_1",
"click_action_2" : "OPEN_ACTIVITY_2"**
}
}
According to the reference documentation, there is only a single click_action parameter per message. If you want the user to take a follow-up action, you'll have to implement inside the code that handles their initial click.
This sounds a bit like a ;XY problem though.
Related
I got a problem,
1 ) I'm using Firebase to send remote Push Notifications, i test by sending from FCM tester.
2 ) I've activated Deep-Linking in my project and started to use it.
3 ) In FCM tester i pass this key value into "notifications.data" :
{ "link" : "MY_LINK" }
Now i want my app to be able to recognize there is a deepLink in it & read it.
Which i achieved to do somehow but not the way i was looking for.
What i did :
NotificationContextProvider.ts
useEffect(() => {
const unsubscribeClosedApp = messaging().onNotificationOpenedApp(
remoteMessage => {
addNotification(remoteMessage);
console.log(
'Notification caused app to open from background state:',
remoteMessage.notification,
);
redirectFromKey(remoteMessage.data?.redirection);
console.log(remoteMessage.data, 'remote message data');
console.log(remoteMessage, 'remote message full');
console.log(remoteMessage.notification?.body, 'remote message body');
console.log(remoteMessage.notification?.title, 'remote message title');
if (remoteMessage.data?.link === 'https://[MY-LINK]/TnRV') {
console.log(remoteMessage.data?.link, 'Deeplink detected & opened');
navigation.navigate({
name: 'Logged',
params: {
screen: 'Onboarded',
params: {
screen: 'LastAnalyse',
},
},
});
}
},
);
And it's working fine but it's not based on reading a link, but by comparing a value and it's not what i'm trying to achieve.
Firebase Doc' give us a way to do this : https://rnfirebase.io/dynamic-links/usage#listening-for-dynamic-links
This is what Firebase suggests :
import dynamicLinks from '#react-native-firebase/dynamic-links';
function App() {
const handleDynamicLink = link => {
// Handle dynamic link inside your own application
if (link.url === 'https://invertase.io/offer') {
// ...navigate to your offers screen
}
};
useEffect(() => {
const unsubscribe = dynamicLinks().onLink(handleDynamicLink);
// When the component is unmounted, remove the listener
return () => unsubscribe();
}, []);
return null;
}
And i have no clue how to make it works.
I got to mention that deep-links are correctly setup in my project and working fine, my code is in Typescript.
Basicaly you can find on this web page what i'm trying to achieve but i want to use Firebase/messaging + Dynamic links. My project don't use local notifications and will never do : https://medium.com/tribalscale/working-with-react-navigation-v5-firebase-cloud-messaging-and-firebase-dynamic-links-7d5c817d50aa
Any idea ?
I looked into this earlier, it seems that...
You can't send a deep link in an FCM message using the firebase Compose Notification UI.
You probably can send a deep link in an FCM message using the FCM REST API. More in this stackoverflow post.
The REST API looks so cumbersome to implement you're probably better off the way you're doing it: Using the firebase message composer with a little data payload, and your app parses the message data with Invertase messaging methods firebase.messaging().getInitialNotification() and firebase.messaging().onNotificationOpenedApp().
As for deep linking, which your users might create in-app when trying to share something, or you might create in the firebase Dynamic Links UI: For your app to notice actual deep links being tapped on the device, you can use Invertase dynamic links methods firebase.dynamicLinks().getInitialLink() and firebase.dynamicLinks().onLink().
I know how to pass a custom parameter from a DynamicLink created in FireBase and get it on my app but the problem is that I can only make this work with the large link version, like this:
https://example.page.link/?link=https://example.com.br/?PARAMETER=VALUE&apn=com.example.br
The problem is that the link is too large, how can I send CUSTOM parameter with the short version from DynamicLink on Firebase?
You can probably get it to work if you send a request body instead of URL parameters. The REST docs explain how to:
{
"dynamicLinkInfo": {
"domainUriPrefix": string,
"link": string,
},
"suffix": {
"option": "SHORT" or "UNGUESSABLE"
}
}
I'm updating my application to use the LinkedIn API V2 and OAuth 2.0,. The changes works as expected retrieving the basic data (r_liteprofile, r_emailaddress)
However, I need retrieve some fields related to full profile (e.g, skills, educations) and others that previously were into the r_basicprofile (positions), but that fields are missing in the linkedIn response. here's the call that I'm using to get the data
https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,educations,skills, positions)&oauth2_access_token=ACCES_TOKEN
And here's the response that I'm getting
{
"firstName" : {
"localized" : {
"es_ES" : "Johan"
},
"preferredLocale" : {
"country" : "ES",
"language" : "es"
}
},
"lastName" : {
"localized" : {
"es_ES" : "Rincon"
},
"preferredLocale" : {
"country" : "ES",
"language" : "es"
}
},
"id" : "MY_LINKED_IN_ID"
}
My linkedIn app currently is working with the old API V1 and already has access to the r_fullprofile, so, with API V1 I'm getting the full profile fields as expected.
I've researched some hours, and the difference with other cases is that my app already has access to full profile (granted from V1)
My questions are:
Am I need request again access to the full profile ?
Am I doing some wrong for the API V2?
Here's the attachment where I'm verifying that I'm requesting the expected scopes
Requesting litle profile, email and full profile
In V2 for using r_fullprofile you have to apply for partner program
after approval only you can use r_fullprofile
Have you tried calling the API with field projection like this:
https://api.linkedin.com/v2/me?fields=id,firstName,lastName,educations,skills,positions
According to the documentation you should request the required fields this way:
https://learn.microsoft.com/en-us/linkedin/shared/api-guide/concepts/projections
Hope it helps!
I want to push firebase notification dynamically every device different notification in bulk using asp.net
https://android.googleapis.com/gcm/send
[{
"to" : "eqGiWA3POYA:APA91bHXf-Eo9aUI-XtIdHUcGrWaNtfgjPM3luED2LRAafAvemPIBOoUEXFCjnnoAL5xOXescizfpafi-RqwssuyHclShImoYNzYaAjrrw03rLPMLUjN7pAW3RJj1P3f07VJxGBmGm6z",
"collapse_key" : "type_a",
"notification" : {
"body" : "Body of Your Notification",
"title": "Title of Your Notification"
},
"data" : {
"body" : "Body of Your Notification in Data",
"title": "Title of Your Notification in Title",
"key_1" : "Value for key_1",
"key_2" : "Value for key_2"
}
}]
it's working on single message multiple device.
I need different message different device based on device registered id.
According to this documentation it doesn't seem possible to do what you are trying to do. You would need to send the messages in a loop seperatly.
I've tried
https://api.linkedin.com/v1/people/~/connections:(id,first-name,last-name,phone-numbers)
but it's only get (id,first-name,last-name)
even this:
http://api.linkedin.com/v1/people/id=UserId:(phone-numbers)
Does LinkedIn expose this field ? I've google it, but not found somewhere ..
Linkedin Not provide phone numbers of connections. They only provide basic profile of connections.
check here https://developer.linkedin.com/documents/connections-api
LinkedIn will provide the phone number if the user authorizes r_contactinfo
Sample Request URL:
https://api.linkedin.com/v1/people/~:(id,phone-numbers)?format=json
Sample JSON Response:
{
"id": "ye3i9-_24l",
"phoneNumbers": {
"_total": 1,
"values": [
{
"phoneNumber": "89xx189198",
"phoneType": "mobile"
}
]
}
}
LinkedIn not provide phone number. Check this document for accessible fields of profile
Basic Profile Fields