function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
OFröhlichOFröhlich 

Android Push Notification (Salesforce App) - PUSH_NOTIFICATION_INVALID_APP

Hi,
I'm trying to send a push notification to the standard salesforce app (salesforce for android) by an apex class. Notifications from chatter or approvals work fine.
Enclosed my test code and the error message I get. Any ideas what's the right API name for salesforce for android? Chatter_for_Android does not work.

Messaging.PushNotification msg = new Messaging.PushNotification();
Map<String, Object> androidPayload = new Map<String, Object>();
androidPayload.put('number', 1);
androidPayload.put('name', 'test');
msg.setPayload(androidPayload);
String userId1 = '005200000016UYe';
Set<String> users = new Set<String>();
users.add(userId1);                      
msg.send('Chatter_for_android', users);

13:15:40.21 (22939313)|PUSH_NOTIFICATION_INVALID_APP||Chatter_for_Android 13:15:40.21 (23141398)|SYSTEM_MODE_EXIT|false 13:15:40.21 (23282513)|FATAL_ERROR|System.NoAccessException: Invalid connected application: Chatter_for_Android Class.Messaging.PushNotification.send: line 28, column 1 AnonymousBlock: line 9, column 1 AnonymousBlock: line 9, column 1