Groups
Groups
Sign in
Groups
Groups
AIR/Flash for Android
Conversations
About
Send feedback
Help
AIR for Androidへのプッシュ通知について
4 views
Skip to first unread message
知識
unread,
Feb 22, 2014, 12:29:24 PM
2/22/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AF...@googlegroups.com
まだこのグループが生きていることを願って。。
AirPushNotification.ane、というANEを利用して、AIR for AndroidとAIR for iOSにて、プッシュ通知の開発を行っています。
同じソースコードで対応出来るのは素晴らしいですね!
AIR for iOSでは成功しましたが、AIR for Androidでつまづいてます。このANEを利用してAndroidへプッシュ通知が出来た方がいらっしゃいましたら、ぜひ教えて下さい。
(Google側の設定とマニフェスト修正は完了しているとして下さい。)
AirPushNotificationで発生するイベントは「3種類」と把握しています。
1.PERMISSION_GIVEN_WITH_TOKEN_EVENT
ここで端末IDはtraceで表示されていて、成功だと思っています。
2.PERMISSION_REFUSED_EVENT
エラーは発生していないようで、このイベントは発生しません。
3.COMING_FROM_NOTIFICATION_EVENT
これでメッセージを受け取ると思うのですが、ここで仕掛けているコールバックメソッドのtraceが何も表示されません。
ただし、ANE内のスクリプトで3のイベントが発生する動きをします。(ANE内のisPushNotificationSupported()が、プッシュのタイミングで実行される。)
var PN:PushNotification = PushNotification.getInstance();
PN.registerForPushNotification(GCM_SENDER_ID);
PN.addEventListener(PushNotificationEvent.PERMISSION_GIVEN_WITH_TOKEN_EVENT, testhandler);
PN.addEventListener(PushNotificationEvent.PERMISSION_REFUSED_EVENT, testErrhandler );
PN.addEventListener(PushNotificationEvent.COMING_FROM_NOTIFICATION_EVENT, testComhandler );
public function testhandler(e:PushNotificationEvent):void
{
trace('tokenID='+e.token); // これは表示されます。
}
public function testComhandler(e:PushNotificationEvent):void
{
trace('Push Receive='+e.parameters); // これは表示されませんが、イベントは発生しているようです。
}
ご教示いただければ幸いです。よろしくお願いします。
それにしても、AIR for iOS と AIR for Android の最新情報が少ないです。皆さんどこにいらっしゃるのでしょうか^^;??
kaz T
unread,
Mar 7, 2014, 3:21:56 AM
3/7/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AF...@googlegroups.com
東海と申します。
今こちらのグループについて気がついたのですが、下記の方法のようにGCMで送るときにparametersも指定したらどうでしょうか。
https://github.com/freshplanet/ANE-Push-Notification/issues/18#issuecomment-27519903
ソースを見た感じ、parametersをJSONとしてパース出来ないとCOMING_FROM_NOTIFICATION_EVENTが呼ばれないような感じがです。
よろしくお願いします。
2014年2月23日日曜日 2時29分24秒 UTC+9 知識:
知識
unread,
Mar 7, 2014, 8:58:51 AM
3/7/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AF...@googlegroups.com
ありがとうございます!
一応、パラメータを指定して送っています。このサーバに置いたPHPとか、よく見直してみます。
2014年3月7日金曜日 17時21分56秒 UTC+9 kaz T:
Reply all
Reply to author
Forward
0 new messages