【问题标题】:How to add billing permissions to config.xml file for cordova phonegap project?如何为cordova phonegap 项目的config.xml 文件添加计费权限?
【发布时间】:2019-01-23 12:14:18
【问题描述】:

我正在尝试使用 config.xml 向我的 phonegap cordova 项目添加 android 计费权限。它不工作。

我尝试过使用编辑配置。我尝试将 xmlns:android 添加到小部件。

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.widlugames.theotherside" version="1.1.4" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0"
        xmlns:android="http://schemas.android.com/apk/res/android">
    <name>TheOtherSide</name>
    <description>
        An interactive novel
    </description>
    <author email="support@phonegap.com" href="http://phonegap.com">
        PhoneGap Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <preference name="android-minSdkVersion" value="26"/>
    <preference name="android-maxSdkVersion" value="28"/>

    <platform name="android">
    <edit-config file="AndroidManifest.xml" target="/manifest/uses-permission" mode="merge">
        <uses-permission android:name="com.android.vending.BILLING" />
    </edit-config>
    </platform>

</widget>

我希望能够将 apk 上传到 google play 并能够添加应用内购买,但是当我上传 apk 时,它说我需要先添加 android 计费权限才能添加购买。

【问题讨论】:

  • 你有没有想过这个问题?

标签: android cordova phonegap


【解决方案1】:

用你现有的platform标签替换你现有的标签并尝试一下:

<platform name="android">
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <uses-permission android:name="com.android.vending.BILLING" />
        </edit-config>
</platform>

【讨论】:

    猜你喜欢
    • 2015-09-29
    • 1970-01-01
    • 2013-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-11
    • 2013-08-06
    • 2017-01-30
    相关资源
    最近更新 更多