Android GCM クライアントとサードパーティ サーバーがあります。サードパーティのサーバー側では、保留中のインテントで開始するアクティビティを Android アプリケーションに伝えたいと思います。そうする可能性はありますか?
次のようなものをハードコードすることはできません
Intent notificationIntent = new Intent(context, MainActivity.class);
まだどのActivityを起動したいのかわからないので…サーバー側にURIを追加してみました
Message msg = new Message.Builder()
.collapseKey("push")
.delayWhileIdle(true)
.addData("ACTION",
"de.company.myApp.Activity.class")
.addData("MESSAGE",
"messageText")
.build();
クライアント側でそれを取得するには
String intentUri = intent.getStringExtra("ACTION");
と
Intent notificationIntent = Intent.parseUri(intentUri, 0);
しかし、うまくいきません。
何か案は?