PushService onMessage() not Working, PushReceiver onMessage() working

This is code working in PushReceiver class extended from BackendlessBoradcastReceiver


	@Override
	@Deprecated
	public boolean onMessage(Context context, Intent intent) {
		String message = intent.getStringExtra(PublishOptions.MESSAGE_TAG);
		Log.d("MESSAGE CONTENTS", message);
		try {
			JSONObject jsonObject = new JSONObject(message);


			nameValue = jsonObject.getString(TAGS.TAG_NAME);
			messageTitle = jsonObject.getString(TAGS.TAG_MESSAGE_TYPE);
			jsonObject.put(TAGS.TAG_JSON_RECEIVED_DATE_TIME,
					TAGS.getCurrentTime());
			// make sure its not the message originated from the same
			// device ID
			if (!jsonObject.getString(TAGS.TAG_DEVICE_ID).equals(
					MainActivity.prefs.getString(TAGS.TAG_DEVICE_ID))) {
				processNotification(context, message);
			}


		} catch (JSONException e) {
			e.printStackTrace();
			processAdminNotification(context, message);
		}
		// Saving Data
		Log.d("SAVESAVE", "Receiver DID THIS");


		new AppSettings(context).saveDataOnDrive();
		return true;
} // working fine.............

This same code written in MyPushService extended from BackendlessPushService doesnt works, it wont even log it out. I did read documentation, checked with PushDemo from SDK.
It like its never reached.


	@Override
public boolean onMessage(Context context, Intent intent) {
		String message = intent.getStringExtra(PublishOptions.MESSAGE_TAG);
		Log.d("MESSAGE CONTENTS", message);
		try {
			JSONObject jsonObject = new JSONObject(message);


			nameValue = jsonObject.getString(TAGS.TAG_NAME);
			messageTitle = jsonObject.getString(TAGS.TAG_MESSAGE_TYPE);
			jsonObject.put(TAGS.TAG_JSON_RECEIVED_DATE_TIME,
					TAGS.getCurrentTime());
			// make sure its not the message originated from the same
			// device ID
			if (!jsonObject.getString(TAGS.TAG_DEVICE_ID).equals(
					MainActivity.prefs.getString(TAGS.TAG_DEVICE_ID))) {
				processNotification(context, message);
			}


		} catch (JSONException e) {
			e.printStackTrace();
			processAdminNotification(context, message);
		}
		// Saving Data
		Log.d("SAVESAVE", "Receiver DID THIS");


		new AppSettings(context).saveDataOnDrive();
		return true;
	}

Please shed some light on this issue, because i am forced to use Deprecated method…
Thanks,

Hi,
Did you register your PushService in Broadcast receiver like this?
public class MyPushReceiver extends BackendlessBroadcastReceiver
{
@Override
public Class<? extends BackendlessPushService> getServiceClass()
{
return MyPushService.class;
}
}
Also don`t forget about the manifest. Here is docs, please read it carefully https://github.com/Backendless/Android-SDK/blob/master/docs/push.md.
Artur

Thanks, as Always, You guys are supportive.

I noticed my mistake in Manifest. I didn’t mentioned sub-package name in which the PushService was created. Writing full package name

        &lt;service android:name=&quot;com.example.name..receiverClasses.PushService&quot; /&gt;