首页 > 解决方案 > 是否可以从 React Native 重定向到本机设置页面以进行订阅管理?

问题描述

我正在尝试重定向到 React Native 上的订阅页面。

我在网上找到的如何做到这一点的代码是这样的:

Linking.openURL(
  "https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions"
);

对于 iOS

和这个:

    Linking.openURL(
      "https://play.google.com/store/account/subscriptions?package=YOUR_PACKAGE_NAME&sku=YOUR_PRODUCT_ID"
    );

对于安卓。

我还无法测试 Android 链接,因为我还没有创建相关的包名称或产品 ID,但我尝试了 iOS 链接,它没有重定向到设置/订阅管理页面。

我得到的只是带有 iOS 链接的错误消息(在物理设备上 - 以及在模拟器中) - 即使我在物理设备上完全登录了我的 Apple 帐户:

pings metrics dialogIdMZFinance.ManageSubscriptionsLoginRequired messageSign in to manage subscri messageCode5074 options Manage Subscriptions CancelactionUrlbuy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptionseventTypedialog failureType5074 customerMessageSign in to manage subscriptions. m-allowed dialog kindauthorization m-allowed messageSign in to manage subscriptions.explanationEnter your Apple ID and password and click Manage Subscriptions.defaultButtonok okButtonStringManage Subscriptions okButtonActionkindGotourlhttps://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/com.apple.jingle.app.finance.DirectAction/manageSubscriptionscancelButtonStringCancel initialCheckboxValue cancel-purchase-batch

我希望用户能够单击一个按钮并被发送到该页面(以防他们想取消订阅)。

有没有办法做到这一点?

标签: androidiosreact-native

解决方案


显然新的网址是

https://apps.apple.com/account/subscriptions

我会在确认 Android 链接后更新。


推荐阅读