I am unable to receive app notifications in emulator
I've used this tutorial to set up clover in genymotion https://jamescha.gitbooks.io/clover-code-lab/content/setup_genymotion.html
On App Side I have this code which is listening for notifications
public class OrderNotificationListener extends AppNotificationReceiver { public final static String TEST_NOTIFICATION_ACTION = "printOrder"; @Override public void onReceive(Context context, AppNotification notification) { try { if (notification.appEvent.equalsIgnoreCase(TEST_NOTIFICATION_ACTION)) { Log.d("MyApp", "Intent received NOTIFICATION " + notification.payload); Intent intent = new Intent(context, PrintOrderService.class); intent.putExtra(PrintOrderService.K_ORDER_ID, notification.payload); context.startService(intent); } } catch (Exception e) { Log.d(OrderNotificationListener.class.getSimpleName(), e.getMessage()); } } }
Even registered in manifest
<receiver android:name=".OrderNotificationListener" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="com.clover.sdk.app.intent.action.APP_NOTIFICATION"> </action> </intent-filter> </receiver>
I am using this URL to send notifications , response is successful as it returns {}
https://apisandbox.dev.clover.com/v3/apps/{aId}/merchants/{mId}/notifications
No error log is generating so not sure what is the issue.