解析推送通知不能在Android上工作 [英] Parse Push Notification not work on android

查看:155
本文介绍了解析推送通知不能在Android上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的解析推送通知我的Andr​​oid应用程序。 我按照教程,我立即下载jar文件,并比其导入到我的项目,我已经加入此code到我的清单

I am using parse push notification for my android app. I follow tutorial and i downlaod jar file and than import it into my project and i have added this code into my manifest

<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>

此外,我已经添加application.class到我的我的包和code是

Also i have added application.class into my my package and code is

public class Application extends android.app.Application {

    public Application() {
    }

    @Override
    public void onCreate() {
        super.onCreate();

        // Initialize the Parse SDK.
        Parse.initialize(this, "zzxxxxxxxxxxxxxxVv", "wyxxxxxxxCElxxxxxxx"); 

        // Specify a Activity to handle all pushes by default.
        PushService.setDefaultPushCallback(this, MainActivity.class);

        // Save the current installation.
        ParseInstallation.getCurrentInstallation().saveInBackground();
    }
}

在我的主要活动我这样做

In my main activity i do this

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ParseAnalytics.trackAppOpened(getIntent());

    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    Log.e("MainActivity", "oncreate");
    setContentView(R.layout.activity_main);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

有人说,它的问题在清单中的应用程序名称attribut所以我aaded该室内用行我pacakge名称

Some says that it problem with name attribut in application in manifest so i aaded this line wiht my pacakge name

 <application
    android:name="com.test.pushnotificationTest.Application"

在解析仪表盘,当我安装的应用程序到新的设备,比我获得新进入dashboard..but当我尝试发送推送通知,我不明白这一点。 我是否需要添加brodcast接收器?但它不具有相同的播出code工作之前, 帮助我的家伙

In parse dashboard when i install app into new device than i get new entry into dashboard..but when i try to send push notification i dont get it. Do i need to add brodcast receiver?? but it was working before with same code without broadcast help me guys

推荐答案

解析API有时会滞后于Android的推送邮件传递... 我得到了推送通知时,我签我的apk ..再次尝试与签署的apk。

parse api sometimes lags for push message delivery for android... i got push notification when i signed my apk.. try it again with signed apk.

这篇关于解析推送通知不能在Android上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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