Ahoy!
So im trying to send notifications to my android app.
I have everything done, i have a class extending AppNotification:
public class MyNotificationReceiver extends AppNotificationReceiver {
final public static String NOTIFICATION_ACTION = "notif";
final public static String NOTIFICATION_EXTRA_KEY = "extra_params";
public MyNotificationReceiver() { }
@Override
public void onReceive(Context context, AppNotification notification) {
Helper.logMe("Notif: "+notification.toString());
if (notification.appEvent.equals(NOTIFICATION_ACTION)) {
Helper.logMe("Got it!");
Intent intent = new Intent(context, Webby.class);
intent.putExtra(NOTIFICATION_EXTRA_KEY, notification.payload);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
}
}
I also have the manifest properly set:
<receiver android:name=".classes.MyNotificationReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.clover.sdk.app.intent.action.APP_NOTIFICATION" />
</intent-filter>
</receiver>
On my Webby activity i have this:
@Override
protected void onNewIntent(Intent intent) {
Helper.logMe("Done: "+intent.getStringExtra(MyNotificationReceiver.NOTIFICATION_EXTRA_KEY));
}
Im not getting logs when sending POST requests using https://www.clover.com/api_docs/#!/no... (i get a 200 response code and an empty json string response body).
Is there some problem with the push server or im doing something wrong?
Thanks.
Cheers.