Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services ADM客户端未接收到消息_Amazon Web Services_Amazon Sns - Fatal编程技术网

Amazon web services ADM客户端未接收到消息

Amazon web services ADM客户端未接收到消息,amazon-web-services,amazon-sns,Amazon Web Services,Amazon Sns,我正在尝试将SNS消息发送到Firephone,虽然我似乎正在发送消息(到某个地方),但我的Firephone似乎没有收到任何消息 我能够使用文档中的代码创建KindleMobilePushApp,能够生成注册ID,我为测试应用创建了安全配置文件,等等。如果我获得了注册ID,我假设我一定做了正确的事情 然后我尝试向手机发送消息,使用Kindle demo应用程序接收消息,但似乎没有收到任何消息,ADMHandler的“onMessage”方法从未被调用 我试图通过AWS SNS控制台和文档中提供

我正在尝试将SNS消息发送到Firephone,虽然我似乎正在发送消息(到某个地方),但我的Firephone似乎没有收到任何消息

我能够使用文档中的代码创建KindleMobilePushApp,能够生成注册ID,我为测试应用创建了安全配置文件,等等。如果我获得了注册ID,我假设我一定做了正确的事情

然后我尝试向手机发送消息,使用Kindle demo应用程序接收消息,但似乎没有收到任何消息,ADMHandler的“onMessage”方法从未被调用

我试图通过AWS SNS控制台和文档中提供的java应用程序(SNS.samples.mobilepush)发送消息,java应用程序似乎发布了一些东西,但再一次,它没有传到我的firephone,或者至少我的Receiver类没有收到

我以前从未使用过SNS,所以我不确定问题出在哪里,是我没有发送到正确的端点,还是我的应用程序没有收到它应该收到的消息。CloudWatch报告的“已发布消息”和“失败消息”的数量相同,但实际上不知道消息发生了什么

你觉得我应该去哪里?下面是我的清单,并发布来自java sender程序的结果

<!-- Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.  -->
<!-- Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at -->
<!--     http://aws.amazon.com/apache2.0/ -->
<!-- or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:amazon="http://schemas.amazon.com/apk/res/android"
    package="com.grapevine.snstest"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="17" />

   <!-- This permission ensures that no other application can intercept your ADM messages. It
   should have the form packagename.permission.RECIEVE_ADM_MESSAGE where packagename is the
   name defined in the "package" property of the manifest tag. --> 
    <permission android:name="com.grapevine.snstest.permission.RECEIVE_ADM_MESSAGE"
        android:protectionLevel="signature"/>

    <!-- Required permissions -->
    <uses-permission android:name="com.grapevine.snstest.permission.RECEIVE_ADM_MESSAGE"/>
    <uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"        
        android:theme="@style/AppTheme" >
        <uses-permission android:name="com.grapevine.snstest.permission.RECEIVE_ADM_MESSAGE"/>
        <activity
            android:name="com.grapevine.snstest.KindleMobilePushApp"
            android:screenOrientation="portrait"
            android:label="@string/title_activity_main"
            android:launchMode="singleTop" >
            <uses-permission android:name="com.grapevine.snstest.permission.RECEIVE_ADM_MESSAGE"/>
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- Your application's API Key -->
        <!--<meta-data android:name="AmazonAPIKey" android:value="@string/api_key"/>-->

        <!--  Declare your ADMMessageHandlerBase implementation as a service -->
        <service android:name="com.grapevine.snstest.ADMMessageHandler"
            android:exported="false" />

        <!-- You must explicitly enable ADM. You must also declare whether your application will run with or without ADM.
        If you specify android:required="false", your app must degrade gracefully when ADM is unavailable. -->
        <amazon:enable-feature android:name="com.amazon.device.messaging" 
            android:required="true" />

        <receiver android:name="com.grapevine.snstest.ADMMessageHandler$MessageAlertReceiver"
                  android:permission="com.amazon.device.messaging.permission.SEND">
            <uses-permission android:name="com.grapevine.snstest.permission.RECEIVE_ADM_MESSAGE" />
            <intent-filter>
               <action android:name="com.amazon.device.messaging.intent.REGISTRATION" /> 
               <action android:name="com.amazon.device.messaging.intent.RECEIVE" /> 
               <category android:name="com.grapevine.snstest"/>
            </intent-filter>
        </receiver>       
    </application>

</manifest>

哎呀,这不起作用,因为开发者门户中的应用程序没有启用SNS消息

===========================================

Getting Started with Amazon SNS
===========================================

{PlatformApplicationArn: arn:aws:sns:us-west-2:308914227153:app/ADM/SNSTest}
{EndpointArn: arn:aws:sns:us-west-2:3089xxx53:endpoint/ADM/SNSTest/66xxxf-1f06-3xx1-b887-fxxxxbe19}
{Message Body: {"ADM":"{\"data\":{\"message\":\"Hello World! \"},\"expiresAfter\":1000,\"consolidationKey\":\"Welcome\"}"}}
{Message Attributes:}
Published! 
{MessageId=90f09248-e65b-5713-a6da-debb8e5afcef}

Process finished with exit code 0