gpt4 book ai didi

Android 通知 speedy_c2dm

转载 作者:行者123 更新时间:2023-11-29 01:58:52 25 4
gpt4 key购买 nike

第一次从 rails 服务器发送 android 推送消息的用户。使用https://github.com/sghael/speedy_c2dm已经在 Google 注册了我的项目,并且项目 ID 获得了 Android 设备的 Registration_ID。现在,尝试下面的 test.rb,但没有任何内容发送到手机。

require 'rubygems'
require 'bundler'
Bundler.setup(:default, :development)
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'speedy_c2dm'


TEST_EMAIL = "my_push_email@gmail.com"
TEST_PASSWORD = "MY_PASSWORD"
TEST_REGISTRATION_ID = "DEVICE_TOKEN_RECEIVED_FROM_PHONE"

speedyC2DM = SpeedyC2DM::API.new(TEST_EMAIL, TEST_PASSWORD)

options = {
:registration_id => TEST_REGISTRATION_ID,
:message => "Hi!",
:extra_data => 42,
:collapse_key => "some-collapse-key"
}


response = speedyC2DM.send_notification(options)

有什么建议……如果我遗漏了什么……?

最佳答案

speedy_c2dm 1.0.2

AFAIK Speedy C2DM efficiently sends push notifications to Android devices via google c2dm.

但是作为documentation说你应该改用 GCM

Important: C2DM has been officially deprecated as of June 26, 2012. This means that C2DM has stopped accepting new users and quota requests. No new features will be added to C2DM. However, apps using C2DM will continue to work. Existing C2DM developers are encouraged to migrate to the new version of C2DM, called Google Cloud Messaging for Android (GCM). See the C2DM-to-GCM Migration document for more information. Developers must use GCM for new development.

关于Android 通知 speedy_c2dm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13741766/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com