针对Kindle Fire推送通知/ C2DM?

Art*_*kii 13 android push-notification android-c2dm kindle-fire

AFAIK,推送通知需要一个Google帐户才能运行(他们背负着GTalk),那么对于Kindle Fire的应用程序来说,如果他们使用标准的C2DM方法,那注定会失败吗?

我在Kindle Fire常见问题解答或网络上的任何地方找不到有关推送的任何信息.

ste*_*bot 12

据我所知是的.我读过的所有内容都表明亚马逊已经消除了火灾中的C2DM支持.我知道,对吧?如果您或您的用户愿意将其root用户,则可以选择安装Google服务.

Urban Airship有一项名为Helium的推送服务,据称可与Kindle Fire合作.我还没有尝试过.

2013年8月13日更新

亚马逊SNS也有.关于这个主题有一个很棒的博客.

有关如何实现接收器的信息,请参阅此代码段(来自Amazon Web Services博客):

public class ExternalReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.i("ExternalReceiver","onReceive");
        Bundle extras = intent.getExtras();
        StringBuilder payload = new StringBuilder();

        for(String key : extras.keySet()){
            payload.append(String.format("%s=%s", key, extras.getString(key)) + '\n');
        }

        Intent newIntent = new Intent();
        newIntent.setClass(context, AndroidMobilePushApp.class);
        newIntent.putExtra(context.getString(R.string.msg_field), payload.toString());
            newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
        context.startActivity(newIntent);
    }
}
Run Code Online (Sandbox Code Playgroud)