In this topic you described difference between pub/sub and push notifications:
Pub/Sub messages:
- App which receives messages must be running.
public static void sendJoinRequest(String groupId) {
String channel = "ch"+ groupId;
String senderName = User.getName();
Group group = (Group) User.getUser().getProperty("group");
PushObject pushObject = new PushObject();
pushObject.setSenderName(senderName);
pushObject.setSenderId(User.getUser().getObjectId());
pushObject.setSendersGroup(group.getObjectId());
pushObject.setPushType(PushObject.JOIN_REQUEST);
Backendless.Messaging.publish(channel, new Gson().toJson(pushObject), new AsyncCallback<MessageStatus>() {
@Override
public void handleResponse(MessageStatus response) {
BusProvider.getInstance().post(new BackendlessCallbackEvent(true));
Log.d(LOG_TAG, response.toString());
}
@Override
public void handleFault(BackendlessFault fault) {
Log.e(LOG_TAG + ".sendJoinRequest", fault.toString());
}
});
}
<receiver android:name=".utilities.PushReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
<category android:name="com.fliptripapp.fliptrip"/>
</intent-filter>
</receiver>
Am I missing something here?