Hi Backendless Team, I’m having issues when trying to publish push notifications in this way:
One app publishes push notification to other app (both app’s are working with different backendless projects )
this is the code for the first app:
PublishOptions po = new PublishOptions();
po.putHeader( PublishOptions.ANDROID_TICKER_TEXT_TAG,"User “+” “+current_user.getProperty(“name”).toString() +” “+current_user.getProperty(“last_name”)+” "+“wants to talk to you”);
po.putHeader( PublishOptions.ANDROID_CONTENT_TITLE_TAG, getResources().getString( R.string.app_name ) );
po.putHeader( PublishOptions.ANDROID_CONTENT_TEXT_TAG, “Message”);
// po.putHeader(PublishOptions.MESSAGE_TAG,“MENSAJE DE PRUEBA”);
DeliveryOptions deliveryOptions = new DeliveryOptions();;
deliveryOptions.setPushPolicy( PushPolicyEnum.ONLY );
deliveryOptions.addPushSinglecast(doctor.getDeviceId());–>doctor.getDeviceID is the device registered of the second app
final String subtopic=current_user.getEmail().concat( “with” ).concat(doctor.getEmail());
Backendless.Messaging.publish(“default”, subtopic, po, deliveryOptions, new AsyncCallback<MessageStatus>() {
@Override
public void handleResponse(MessageStatus response)
{
PublishStatusEnum messageStatus = response.getStatus();
if (messageStatus==PublishStatusEnum.SCHEDULED)
{
Toast.makeText(this, "Message status: " + messageStatus.toString(), Toast.LENGTH_SHORT ).show(); }
else
{
Toast.makeText( TablaComentarios.this, "Message status: " + messageStatus.toString(), Toast.LENGTH_SHORT ).show();
}
}
@Override
public void handleFault(BackendlessFault fault) {
}
});
but in the second app I don’t get the push notification
Please your support.