Итак, я использую PushSharp для отправки уведомления на С# в мое приложение для Android:
var push = new PushBroker();
push.RegisterGcmService(new GcmPushChannelSettings(androidKey) { });
push.QueueNotification(
new GcmNotification().ForDeviceRegistrationId(registrationId)
.WithJson("{\"alert\":\"" + PushMessageFormater.FormatMessage(ncRuleResult) + "\",\"badge\":7,\"sound\":\"sound.caf\"}"));
Все работает нормально, уведомления отправляются корректно.
Теперь все, что я хочу сделать, это определить из моей MainActivity, открыто ли приложение, когда конечный пользователь нажимает в полученном уведомлении.
protected void onCreate(Bundle savedInstanceState) {
registrationGetter = new RegistrationGetter(this);
super.onCreate(savedInstanceState);
Intent intent = getIntent() ;
// How to check from here if the app is actually open further to a push tap.
}
Все, что я нашел в SO, это то, что мне нужно добавить дополнительную переменную в Intent, но, к сожалению, я не могу найти способ указать Intent от PushSharp.
Заранее спасибо.