We have a custom android build and just figured out the Google Cloud Messaging (GCM) maybe an issue on non Google certified builds.
我们有一个自定义的android构建,并且刚刚计算出了谷歌云消息传递(GCM),这可能是关于非谷歌认证的构建的一个问题。
Assuming that is the case, are there any alternatives out there to GCM?
假设是这样的话,GCM还有其他的选择吗?
4 个解决方案
#1
6
Easiest way to implement push notification in android is parse
在android中实现推送通知最简单的方法是解析
Just register yourself, create new android app.
注册你自己,创建一个新的android应用。
Checkout demo code
结帐演示代码
Integrate your ApplicationID and Client key.
集成您的ApplicationID和客户端密钥。
Run your app and your are set!
运行你的应用,你的设置!
#3
2
I had implemented Push Notification [ Using Urban Air Ship] application in Android, with the help of the steps shown in the Urbran Air Ship documentation
在Urbran Air Ship文档所示的步骤的帮助下,我在Android中实现了推送通知(使用城市飞艇)应用程序
https://urbanairship.com/docs/android_client.html,
https://urbanairship.com/docs/android_client.html,
It works in a nice and fine manner,and also i got notifcation, when my feed is updated. Here's the step what had done.
它工作得很好,而且当我的提要更新时,我也得到了通知。这就是我们所做的。
Step1: Create a Account in Urban Air Ship, https://go.urbanairship.com/
Step1:在Urban Air Ship中创建一个账号,https://go.urbanairship.com/
Step2: Download android_push.jar from here https://github.com/urbanairship/android-push-library/downloads
步骤2:下载android_push。jar从这里https://github.com/urbanairship/android-push-library/downloads
Step3: register the receiver in AndroidManifest.xml before closing your closing your application tag file as shown below
步骤3:在AndroidManifest中注册接收方。关闭应用程序标记文件之前的xml,如下所示
<application>
:
:
:
<receiver android:name="com.urbanairship.push.IntentReceiver">
<intent-filter>
<action android:name="com.urbanairship.airmail.END_REGISTER"></action>
<action android:name="com.urbanairship.airmail.ACCEPT_PUSH"></action>
<action android:name="com.urbanairship.airmail.NOTIFY"></action>
</intent-filter>
</receiver>
</application>
Step 4: Login in your Account, Register Your Application in their site. For that Click Apps option in your account.
步骤4:登录你的帐户,在他们的网站上注册你的应用程序。在你的帐户中点击应用程序选项。
Step5: After Clicking the Apps the icon, you are able to see Add your Application Option as shown in the following diagram
步骤5:点击应用程序图标后,您可以看到添加应用程序选项,如下图所示
Step6: Enter your App Name and Click Push Notification Support, then fed your package name. and Click create your App Button, A new Window will give you,Application Key.
步骤6:输入应用程序名称并单击Push Notification Support,然后输入包名。点击创建你的应用程序按钮,一个新的窗口会给你,应用程序键。
Step 7: Create a file called ua.properties under raw folder which is under in res folder, i.e., res/raw/ua.properties file
步骤7:创建一个名为ua的文件。在res文件夹下的原始文件夹下的属性,例如,res /生/ ua。属性文件
Step8: Fed the Application Key which you got after App registartion in Urban AirShip and also finger print of your App in ua.properties file as shown below.
Step8:输入你在城市飞艇App注册后得到的应用密钥,以及你在ua App的指纹。属性文件如下所示。
debug=true debug.app_key=j9kRTqaCRR-E0xf-iu2XEA production.app_key=9D:54:23:3F:F3:25:AB:0B:DC:8E:D9:C8:B3:F4:96:F9
debug = true调试。app_key = j9kRTqaCRR-E0xf-iu2XEA production.app_key = 9 d:54:23:3F:F3:25:阿瑟:0 b:DC:8 e:D9:C8:B3:F4:96:F9
Step 9: Create a Application Class as shown Below
步骤9:创建一个应用程序类,如下所示
import com.urbanairship.push.APIDReceiver; import
com.urbanairship.push.AirMail; import
com.urbanairship.push.PushReceiver;
import android.app.Application; import android.content.Intent; import
android.util.Log;
public class PushNotification extends Application { public void
onCreate(){ AirMail am = AirMail.getInstance(); am.acceptPush(this,
new PushReceiver() { @Override public void onReceive(String message,
String payload){ Log.d("push", "Got message '" + message +"' and
payload '" + payload + "'"); }
@Override public void onClick(String message, String payload){
Log.d("push", "User clicked the notification, got message and payload:
"
+ message + ", " + payload); /* In this example, we fire up our MainActivity class when the
* user clicks the Status Bar Notification. Note that we *must*
* use the flag Intent.FLAG_ACTIVITY_NEW_TASK to start a new
* activity because this callback is fired from within a
* BroadcastReceiver.
**/ Intent intent = new Intent("android.intent.action.MAIN"); intent.setClass(PushNotification.this,MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PushNotification.this.startActivity(intent); } });
am.setAPIDReceiver(this, new APIDReceiver() { @Override public void
onReceive(String apid, boolean valid){ if(valid){ Log.d("push", "Got
apid: " + apid); } else { Log.d("push", "Application registration
invalid!"); } }
@Override public void onAirMailInstallRefusal() {
Rss_Feed_Grid.register = false; Log.d("push", "AirMail Install
Refused!"); } }); } }
Step 10: Check the following registration code in your Activity
步骤10:在您的活动中检查以下注册代码
protected static boolean register = true;
if(register){ AirMail am = AirMail.getInstance(); am.register(this); }
Step 11: Update Your Manifest in order to register your application
步骤11:更新清单以便注册应用程序
<application android:icon="@drawable/icon"
android:label="@string/app_name" android:name=".PushNotification">
Step12: Now Click Push Notification and then click feed Button in Urbran Air Ship, then fed url which is to be monitored
步骤12:现在点击推送通知,然后点击Urbran航船的feed按钮,然后输入要监控的url
That's it..
就是这样. .
Refer my blog for more information https://sankarganesh-info-exchange.blogspot.sg/p/push-notification-in-android-using.html
更多信息请参考我的博客https://sankarganesh-info-exchange.blogspot.sg/p/push-notification-in android- use .html
#4
2
Paho project is an iot.eclipse.com project, open-source client for MQTT based server.
Paho项目是一个iot.eclipse.com项目,是基于MQTT的服务器的开源客户端。
You may review android application demo example.
您可以查看android应用程序演示示例。
It will connect to MQTT based sandbox server hosted freely by eclipse to test this application.See this server details here
它将连接到由eclipse免费托管的基于MQTT的沙箱服务器,以测试这个应用程序。请参见这里的服务器详细信息。