简体   繁体   English

GCM推送通知adobe air

[英]GCM Push Notification adobe air

I m developing a push notification service for my app in android i came to some tutorials to achieve my goal. 我在android中为我的应用程序开发推送通知服务我来到一些教程来实现我的目标。 I struck to 2 things that i can't figure out. 我找到了两件我无法弄清楚的事情。 I need some help. 我需要协助。

  • PushNotifications.init( "*DEV_KE*Y" ); PushNotifications.init(“* DEV_KE * Y”);
  • <permission android:name="*application ID*.permission.C2D_MESSAGE"

Now i want to know about this 2 things. 现在我想知道这两件事。 Dev_key and application id.Secondly is PushNotifications.init(); necessary to call? Dev_key和应用程序id。其次是PushNotifications.init();需要调用吗? what if i call it without dev_key param? 如果我在没有dev_key param的情况下调用它会怎么样?

I'm guessing you're following the tutorials on distriqt's site about using the distriqt cross platform push notifications extension? 我猜你正在关注distriqt网站上有关使用distriqt跨平台推送通知扩展的教程吗?

If so then the DEV_KEY is actually the developer key you get when you sign up to the distriqt extension package. 如果是这样,那么DEV_KEY实际上是您注册distriqt扩展包时获得的开发人员密钥。 It is necessary to call this function with a valid key if you are hoping to use the distriqt extensions. 如果您希望使用distriqt扩展,则必须使用有效密钥调用此函数。 If you call it without the DEV_KEY param the extension will not work as documented. 如果您在没有DEV_KEY参数的情况下调用它,则扩展将无法按照记录的方式工作。

The second line you have there containing the application ID is used in your application descriptor file. 您在那里包含应用程序ID的第二行将在您的应用程序描述符文件中使用。 You need to add the following to your manifest additions on android replacing all the YOUR_APPLICATION_ID references with your applications id. 您需要在android上的清单添加中添加以下内容,将所有YOUR_APPLICATION_ID引用替换为您的应用程序ID。 This is normally of the form : com.company.name. 通常采用以下形式:com.company.name。 The air prefixes are shown as these are your applications full id on the Android platform. 显示空中前缀,因为这些是Android平台上的应用程序完整ID。

<android>
    <manifestAdditions><![CDATA[
        <manifest android:installLocation="auto">

            <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/>

            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.GET_ACCOUNTS" />
            <uses-permission android:name="android.permission.VIBRATE"/>
            <uses-permission android:name="android.permission.WAKE_LOCK" />
            <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

            <!-- Only this application can receive the messages and registration result --> 
            <permission android:name="air.YOUR_APPLICATION_ID.permission.C2D_MESSAGE" android:protectionLevel="signature" />
            <uses-permission android:name="air.YOUR_APPLICATION_ID.permission.C2D_MESSAGE" />

            <application>
                <receiver android:enabled="true" android:exported="true" android:name="com.distriqt.extension.pushnotifications.PushNotificationsBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
                    <intent-filter>
                        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                        <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                        <category android:name="air.YOUR_APPLICATION_ID" />
                    </intent-filter>
                </receiver>
                <service android:enabled="true" android:exported="true" android:name="com.distriqt.extension.pushnotifications.gcm.GCMIntentService" />
            </application>

        </manifest>

    ]]></manifestAdditions>
</android>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM