Kindle Fire 的推送通知/C2DM? [英] Push notifications / C2DM for Kindle Fire?

查看:20
本文介绍了Kindle Fire 的推送通知/C2DM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AFAIK,推送通知需要一个 Google 帐户才能工作(它们搭载在 GTalk 上),那么这是否意味着 Kindle Fire 应用程序如果使用标准的 C2DM 方法就注定失败?

AFAIK, push notifications require a Google account to work (they piggyback on GTalk), so does that mean for apps for the Kindle Fire are doomed if they use the standard C2DM approach?

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

I couldn't find any info on push in the Kindle Fire FAQ or anywhere on the web.

推荐答案

据我所知是的.我所读到的一切都表明亚马逊从 Fire 中剥离了 C2DM 支持.我知道,对吧?如果您或您的用户愿意对其进行 root,安装 Google 服务是一个选项.

As far as I know yes. Everything I have read indicates that Amazon stripped C2DM support out of the Fire. I know right? If you or your users are willing to root it, installing Google services is an option.

Urban Airship 有一个名为 Helium 的推送服务,据称可与 Kindle Fire 配合使用.不过我还没有尝试过.

Urban Airship has a push service named Helium which purportedly works with Kindle Fire. I have yet to be able to try it though.

2013 年 8 月 13 日更新

还有 亚马逊 SNS.有一个 很棒的博客 主题.

There is also Amazon SNS. There is a great blog on the topic.

请参阅此代码片段以了解如何实现接收器(来自 Amazon Web Services 博客):

See this code snippet for how to implement a receiver ( from the Amazon Web Services blog):

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)) + '
');
        }

        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);
    }
}

这篇关于Kindle Fire 的推送通知/C2DM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆