0

now that push notification is on general release, is there a sample native android app that demonstrates it?

I thought I had the code right when an entry appeared i the "Mobile Push Registrations" page, but when I used the test page to send a JSON string to my app, and set a breakpoint in the interface function, the code never got to the function.

Then I refreshed the "Mobile Push Registrations" page and the entry had disappeared.

My OnCreate code is pretty much a copy and paste from the documentation:

static public ReceivePushNotification rp = new ReceivePushNotification ();;

@Override
public void onCreate() {
  super.onCreate();
  SalesforceSDKManager.initNative(getApplicationContext(), new KeyImpl(), MainActivity.class);
  SalesforceSDKManager.getInstance().setPushNotificationReceiver(rp);
}

and then in the ReceivePushNotification.java file:

public class ReceivePushNotification extends Activity implements PushNotificationInterface {

    @Override
    public void onPushMessageReceived(Bundle message) 
    {
        AlertDialog.Builder builder = new AlertDialog.Builder(getApplicationContext());
        builder.setTitle("Pushed");
        AlertDialog chooseFault = builder.create();
        chooseFault.show();
    }

}

But it never gets into OnPushMessageReceived!

  • Your actual issue seems to be specifically the Android portion and so might receive better answers elsewhere. – dphil Sep 2 '14 at 15:01
  • Did you see any errors when you used the test page to send a push notification? – Aleksandra Jun 12 '15 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.