我有以下接收器,当服务器启动推送通知时它工作得很好。我希望能够使用 ADB 在本地对其进行测试。这是我正在使用的命令:
adb shell am broadcast -a com.parse.push.intent.RECEIVE --es com.parse.Data "Ipsum Lorem" -n com.jon.ticktock/.CustomParseGCMReceiver
这就是在 Manifest 中定义接收者的方式:
<receiver android:name=".CustomParseGCMReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
但是,该命令似乎不会触发此接收器。