我试着为黑莓10重新打包我的安卓应用。它工作得很好,但应用无法接收短信。
在官方BB网站之后,应用程序应该能够处理短信:http://developer.blackberry.com/android/apisupport/unsupportedapi_blackberry10_overview.html
这是我的AndroidManifest.xml:
<receiver android:name="com.test.SMSReceiver" android:enabled="true">
<intent-filter android:priority="2147483647">
<action android:name="android.intent.action.SMS_RECEIVED"/>
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
</intent-filter>
</receiver>
...
<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>我的SMSReceiver.java
public class SMSReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context ctx, Intent intent) {
Log.i(TAG, "SMS Received"); /*...*/
}
}有谁知道为什么这个方法不起作用吗?
发布于 2013-11-05 23:22:46
根据BB的支持,使用移植的Android应用程序无法读取或拦截SMS。你必须使用GCM ( https://developer.blackberry.com/android/apisupport/creating_push-enabled_android_apps.html )
https://stackoverflow.com/questions/17211847
复制相似问题