如何编辑Android.manifest.template.xml文件以接收推送通知

时间:2014-06-08 22:08:31

标签: android ios delphi firemonkey delphi-xe6

让我重新构建这个问题。我的目标是尝试在跨平台Delphi应用程序(iOS和Android)上设置推送通知方面获得一些帮助。我最初通过Embarcadero here跟踪了Sarina Du Pont的博客文章。

我认为您必须使用其他权限条目调整Android.manifest.template.xml文件,正如this博文中所解释的那样。但是,完全这样做后,我的Android应用程序仍然没有收到任何推送通知。我在这里包含了我的Android清单模板文件:

<?xml version="1.0" encoding="utf-8"?>

    package="%package%"

    android:versionCode="%versionCode%"

    android:versionName="%versionName%">


<!-- This is the platform API where NativeActivity was introduced. -->

<uses-sdk android:minSdkVersion="%minSdkVersion%" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />

<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />

<!--
 Creates a custom permission so only this app can receive its messages.

 NOTE: the permission *must* be called PACKAGE.permission.C2D_MESSAGE,
 where PACKAGE is the application's package name.
-->
<permission android:name="%package%.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="%package%.permission.C2D_MESSAGE" />

<!-- This app has permission to register and receive data message. -->
<uses-permission
android:name="com.google.android.c2dm.permission.RECEIVE" />

<application android:persistent="%persistent%"

    android:restoreAnyVersion="%restoreAnyVersion%"

    android:label="%label%"

    android:installLocation="%installLocation%"

    android:debuggable="%debuggable%"

    android:largeHeap="%largeHeap%"

     android:icon="%icon%"

     android:theme="@style/MyTheme.NoTitleBar.SplashWindow">

    <!-- Our activity is a subclass of the built-in NativeActivity framework class.

         This will take care of integrating with our NDK code. -->

    <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"

            android:label="%activityLabel%"

            android:configChanges="orientation|keyboardHidden">

        <!-- Tell NativeActivity the name of our .so -->

        <meta-data android:name="android.app.lib_name"

            android:value="%libNameValue%" />

        <intent-filter>

            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />

        </intent-filter>
    <receiver
          android:name="com.embarcadero.gcm.notifications.GCMNotification" android:exported="true"
          android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
              <action android:name="com.google.android.c2dm.intent.RECEIVE" />
              <category android:name="%package%" />
           </intent-filter>
        </receiver>

    <service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />


    </activity>

    <receiver android:name="com.embarcadero.firemonkey.notifications.FMXNotificationAlarm" />

</application>

我做错了吗?

1 个答案:

答案 0 :(得分:2)

再次仔细阅读教程,它会为您提供下载链接:

  

在不包含OpenSSL库的平台上,例如iOS,您需要下载OpenSSL libraries

如果您关注该链接,您会看到一个OpenSSLStaticLibs.7z文件,其中包含您要查找的2个.a个文件。