You need to sign in to do that
Don't have an account?

Can we send push notification to custom mobile app users(non salesforce users) from Salesforce?
Hi,
We have an app developed on iOS, and our customers will login to that app. the app is integrated with Salesforce. Now I want to send a push notification based on the real time changes to customer records in salesforce.
Steps I followed:
Integrated the mobile app with Salesforce.
Created a connected app, and enabled push notifications.
Saved the devike token in salesforce for each mobile user (non- Salesforce).
Tested the configuration with "Send test notification" option on connected app by providing the device token as recipient, it worked fine.

I tried creating a trigged to send notification, here is the sample code:
Messaging.PushNotification msg =new Messaging.PushNotification();
Map<String, Object> payload =Messaging.PushNotificationPayload.apple('data has been changed', ' ', 0 );
msg.setPayload(payload);
set<string> receipient=new set<string>();
receipient.add('005g00000057P5v');
msg.send('appname', receipient);
In the msg.send method we have to provide connected app name and list of user(salesforce).
But, i want to send the push notification to non salesforce users based on their device token which is generated by APNC and its stored in Salesforce.
Is there any other method to send the push notification based on their device token. Please let me know if my question is not clear.
Please provide some ideas or sample code to handle this situation.
Thanks in advance.
We have an app developed on iOS, and our customers will login to that app. the app is integrated with Salesforce. Now I want to send a push notification based on the real time changes to customer records in salesforce.
Steps I followed:
Integrated the mobile app with Salesforce.
Created a connected app, and enabled push notifications.
Saved the devike token in salesforce for each mobile user (non- Salesforce).
Tested the configuration with "Send test notification" option on connected app by providing the device token as recipient, it worked fine.
I tried creating a trigged to send notification, here is the sample code:
Messaging.PushNotification msg =new Messaging.PushNotification();
Map<String, Object> payload =Messaging.PushNotificationPayload.apple('data has been changed', ' ', 0 );
msg.setPayload(payload);
set<string> receipient=new set<string>();
receipient.add('005g00000057P5v');
msg.send('appname', receipient);
In the msg.send method we have to provide connected app name and list of user(salesforce).
But, i want to send the push notification to non salesforce users based on their device token which is generated by APNC and its stored in Salesforce.
Is there any other method to send the push notification based on their device token. Please let me know if my question is not clear.
Please provide some ideas or sample code to handle this situation.
Thanks in advance.
Best