gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 22:05:36 25 4
gpt4 key购买 nike

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

我了解到您必须使用额外的权限条目来调整您的 Android.manifest.template.xml 文件,正如通过 this 解释的那样。博客文章。然而,在完全这样做之后,我的 Android 应用程序仍然没有收到任何推送通知。我在此处包含了我的 Android list 模板文件:

<?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>

我是不是做错了什么?

最佳答案

再仔细看一遍教程,里面给了你下载链接:

On platforms that do not include OpenSSL libraries, such as iOS, you will need to download OpenSSL libraries.

如果您点击该链接,您将看到 OpenSSLStaticLibs.7z文件,其中包含您要查找的 2 个 .a 文件。

关于android - 如何编辑 Android.manifest.template.xml 文件以接收推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24111362/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com