From 099c0d2db0dd017f2c2873a589e7e4d9072ec965 Mon Sep 17 00:00:00 2001 From: "Ng Wing Tat, David" Date: Thu, 9 Nov 2023 23:20:32 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=94=96=20Bump=20version=20to=200.35.1?= =?UTF-8?q?(347)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 ++-- android/app/build.gradle | 4 ++-- ios/LikeCoinApp.xcodeproj/project.pbxproj | 8 ++++---- ios/LikerLandShare/Info.plist | 4 ++-- package.json | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.env b/.env index c5712d77c..08a343143 100644 --- a/.env +++ b/.env @@ -12,10 +12,10 @@ INIT_APP_TIMEOUT=10000 ROOT_STATE_STORAGE_KEY=root # Same as MARKETING_VERSION in iOS / version in Android -APP_MARKETING_VERSION=0.35.0 +APP_MARKETING_VERSION=0.35.1 # Same as CURRENT_PROJECT_VERSION in iOS / version code in Android -APP_VERSION=346 +APP_VERSION=347 # APP_VERSION must be greater or equal to the this value # without forcing user to update the app diff --git a/android/app/build.gradle b/android/app/build.gradle index 12e63b01b..03c22e0a4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -141,8 +141,8 @@ android { applicationId "com.oice" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 346 - versionName "0.35.0" + versionCode 347 + versionName "0.35.1" missingDimensionStrategy 'react-native-camera', 'general' missingDimensionStrategy 'store', 'play' buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() diff --git a/ios/LikeCoinApp.xcodeproj/project.pbxproj b/ios/LikeCoinApp.xcodeproj/project.pbxproj index 704b6f46c..481b87b47 100644 --- a/ios/LikeCoinApp.xcodeproj/project.pbxproj +++ b/ios/LikeCoinApp.xcodeproj/project.pbxproj @@ -584,7 +584,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = LikeCoinApp/LikeCoinApp.entitlements; - CURRENT_PROJECT_VERSION = 346; + CURRENT_PROJECT_VERSION = 347; DEVELOPMENT_TEAM = 6VG4638588; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -653,7 +653,7 @@ INFOPLIST_FILE = LikeCoinApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 0.35.0; + MARKETING_VERSION = 0.35.1; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -676,7 +676,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = LikeCoinApp/LikeCoinApp.entitlements; - CURRENT_PROJECT_VERSION = 346; + CURRENT_PROJECT_VERSION = 347; DEVELOPMENT_TEAM = 6VG4638588; HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -744,7 +744,7 @@ INFOPLIST_FILE = LikeCoinApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 0.35.0; + MARKETING_VERSION = 0.35.1; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/ios/LikerLandShare/Info.plist b/ios/LikerLandShare/Info.plist index d96e3715d..bc10b46f3 100644 --- a/ios/LikerLandShare/Info.plist +++ b/ios/LikerLandShare/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 0.35.0 + 0.35.1 CFBundleVersion - 346 + 347 NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/package.json b/package.json index 5195d2e82..3f0a96d45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "likecoin-app", - "version": "0.35.0", + "version": "0.35.1", "private": true, "engine": { "node": ">=16" From 1faf4f4560f6ba9e10a326b9c8b0a13f769f82f9 Mon Sep 17 00:00:00 2001 From: William Chong <6198816+williamchong@users.noreply.github.com> Date: Thu, 9 Nov 2023 23:21:14 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20Fix=20Android=20can?= =?UTF-8?q?not=20complete=20WC=20in=20webview,=20support=20`intent://`=20(?= =?UTF-8?q?#402)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/nft-web-view/nft-web-view.tsx | 8 ++++++++ .../wallet-connect-v2-client.ts | 6 +++++- .../nft-notification-screen.tsx | 17 ++++++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/components/nft-web-view/nft-web-view.tsx b/app/components/nft-web-view/nft-web-view.tsx index 71982f679..633c1413e 100644 --- a/app/components/nft-web-view/nft-web-view.tsx +++ b/app/components/nft-web-view/nft-web-view.tsx @@ -36,6 +36,13 @@ export function NFTWebView({ style, onPressRefresh, ...props }: NFTWebViewProps) Linking.openURL(url) return false } + if (url.startsWith("intent://") && url.includes('package=com.oice')) { + Linking.openURL( + url.replace("intent://", "com.oice://") + .replace('#Intent;package=com.oice;scheme=com.oice;end;', '') + ).catch(err => { console.error(err) }); + return false + } return true } @@ -71,6 +78,7 @@ export function NFTWebView({ style, onPressRefresh, ...props }: NFTWebViewProps) {...props} sharedCookiesEnabled={true} decelerationRate={0.998} + originWhitelist={['https://*', 'http://*', 'intent://*']} // TODO: remove HACK after applicationNameForUserAgent type is fixed {...{ applicationNameForUserAgent: COMMON_API_CONFIG.userAgent }} onShouldStartLoadWithRequest={handleShouldStartLoadWithRequest} diff --git a/app/models/wallet-connect-v2-client/wallet-connect-v2-client.ts b/app/models/wallet-connect-v2-client/wallet-connect-v2-client.ts index f7467cfd5..0611d5ab5 100644 --- a/app/models/wallet-connect-v2-client/wallet-connect-v2-client.ts +++ b/app/models/wallet-connect-v2-client/wallet-connect-v2-client.ts @@ -1,3 +1,4 @@ +import { Platform } from "react-native" import { NavigationActions } from 'react-navigation' import { flow, Instance, SnapshotOut, types } from 'mobx-state-tree' import SignClient from '@walletconnect/sign-client' @@ -251,7 +252,10 @@ export const WalletConnectV2ClientModel = types method: 'session_proposal', ...proposal, } - if (!checkIsInAppBrowser(proposal)) { + + /* auto approve is broken in android due to navigation to intent:// */ + const isIos = Platform.OS === "ios" + if (!isIos || !checkIsInAppBrowser(proposal)) { // Show WalletConnect Modal for loading UX self.navigationStore.navigateTo({ routeName: 'App', diff --git a/app/screens/nft-notification-screen/nft-notification-screen.tsx b/app/screens/nft-notification-screen/nft-notification-screen.tsx index 55728b05a..ec5c7a342 100644 --- a/app/screens/nft-notification-screen/nft-notification-screen.tsx +++ b/app/screens/nft-notification-screen/nft-notification-screen.tsx @@ -1,5 +1,5 @@ import * as React from "react" -import { SafeAreaView, StatusBar } from "react-native" +import { Linking, SafeAreaView, StatusBar } from "react-native" import { inject } from "mobx-react" import styled from "styled-components/native" @@ -7,6 +7,7 @@ import { NFTWebView as NFTWebViewBase } from "../../components/nft-web-view" import { WalletConnectStore } from "../../models/wallet-connect-store" import { UserStore } from "../../models/user-store" +import { WebViewNavigation } from "react-native-webview" interface NFTNotificationScreenProps { userStore: UserStore @@ -41,6 +42,18 @@ export class NFTNotificationScreen extends React.Component { console.error(err) }); + return false + } + + return true + } + render() { return ( @@ -53,6 +66,8 @@ export class NFTNotificationScreen extends React.Component ) From 594a60ab4f4aa76b0428ba60bec1ac336ad681ef Mon Sep 17 00:00:00 2001 From: William Chong <6198816+williamchong@users.noreply.github.com> Date: Thu, 9 Nov 2023 23:58:26 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20react-native?= =?UTF-8?q?-iap@10.1.3=20to=20push=20google=20billing=20lib=20version=20(#?= =?UTF-8?q?403)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Podfile.lock | 4 ++-- package.json | 2 +- yarn.lock | 15 ++++----------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index b801366ce..42d6a3681 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -559,7 +559,7 @@ PODS: - RNFBApp - RNGestureHandler (2.12.0): - React-Core - - RNIap (7.5.6): + - RNIap (10.1.3): - React-Core - RNKeychain (3.1.3): - React @@ -971,7 +971,7 @@ SPEC CHECKSUMS: RNFBPerf: 27e85a7451cb366b75bd6ade8a2b912749d0a165 RNFBRemoteConfig: d2c532f1fee5862a7518190211ea2a28123167c5 RNGestureHandler: dec4645026e7401a0899f2846d864403478ff6a5 - RNIap: d248609d1b8937e63bd904e865c318e9b1457eff + RNIap: 45c674b3f57d8c2a80bd926436015cefbf1d2dfd RNKeychain: c658833a9cb2cbcba6423bdd6e16cce59e27da0e RNLocalize: 62a949d2ec5bee0eb8f39a80a48f01e2f4f67080 RNRate: ef3bcff84f39bb1d1e41c5593d3eea4aab2bd73a diff --git a/package.json b/package.json index 3f0a96d45..dc7b0a801 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "react-native-exit-app": "^1.1.0", "react-native-fast-image": "^8.3.2", "react-native-gesture-handler": "^2.5.0", - "react-native-iap": "^7.5.6", + "react-native-iap": "^10.1.3", "react-native-image-picker": "^7.0.1", "react-native-image-sequence": "^0.7.0", "react-native-keychain": "3.1.3", diff --git a/yarn.lock b/yarn.lock index a012fe5c0..35a4b51ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8150,11 +8150,6 @@ domutils@^3.0.1: domelementtype "^2.3.0" domhandler "^5.0.3" -dooboolab-welcome@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/dooboolab-welcome/-/dooboolab-welcome-1.3.2.tgz#4928595312f0429b4ea1b485ba8767bae6acdab7" - integrity sha512-2NbMaIIURElxEf/UAoVUFlXrO+7n/FRhLCiQlk4fkbGRh9cJ3/f8VEMPveR9m4Ug2l2Zey+UCXjd6EcBqHJ5bw== - dot-case@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.3.tgz#21d3b52efaaba2ea5fda875bb1aa8124521cf4aa" @@ -15147,12 +15142,10 @@ react-native-gradle-plugin@^0.0.7: resolved "https://registry.yarnpkg.com/react-native-gradle-plugin/-/react-native-gradle-plugin-0.0.7.tgz#96602f909745239deab7b589443f14fce5da2056" integrity sha512-+4JpbIx42zGTONhBTIXSyfyHICHC29VTvhkkoUOJAh/XHPEixpuBduYgf6Y4y9wsN1ARlQhBBoptTvXvAFQf5g== -react-native-iap@^7.5.6: - version "7.5.6" - resolved "https://registry.yarnpkg.com/react-native-iap/-/react-native-iap-7.5.6.tgz#75a370f0a689da4fbe5ecf2cd9b7bdd0f7d20f2f" - integrity sha512-ua+KTq7NO+/Rw+S9cGDZizR45AdmpQ0LEx9gSubbRD3f5KSTp91mEMHgdyVcqUcxiBuVgRTfv3zy9mbPEdo8Mg== - dependencies: - dooboolab-welcome "1.3.2" +react-native-iap@^10.1.3: + version "10.1.3" + resolved "https://registry.yarnpkg.com/react-native-iap/-/react-native-iap-10.1.3.tgz#7f53d04064a1b6eae7467d05c638c7e1a4bbbe02" + integrity sha512-6Yz6IZ+8UWHIPUWtd6T25UOo57XZ8Waz3fYodcaGpWevovTvTAe36jtilcRJ/xZFVb033UCTfbqjWoIcEyM/JA== react-native-image-picker@^7.0.1: version "7.0.1" From 40ffc7bb0bf3dc37880f4835942066901d89892e Mon Sep 17 00:00:00 2001 From: "Ng Wing Tat, David" Date: Fri, 10 Nov 2023 00:39:18 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=90=9B=20Fix=20react-native-iap=20met?= =?UTF-8?q?hod=20calls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/iapStore/iap-store.ts | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/app/models/iapStore/iap-store.ts b/app/models/iapStore/iap-store.ts index 879d8a56d..434ce4ae8 100644 --- a/app/models/iapStore/iap-store.ts +++ b/app/models/iapStore/iap-store.ts @@ -1,9 +1,13 @@ /* eslint-disable @typescript-eslint/interface-name-prefix */ import { Platform, Alert } from "react-native" -import RNIap, { +import { Product, Purchase, PurchaseError, + getAvailablePurchases, + getProducts, + requestSubscription, + validateReceiptIos, } from "react-native-iap" import { @@ -55,10 +59,13 @@ export const IAPStoreModel = types if (receipt) { // TODO: Validation on Android if (Platform.OS === "ios") { - const result: any = yield RNIap.validateReceiptIos({ - "receipt-data": receipt, - password: self.getConfig("IAP_IOS_SHARED_SECRET"), - }, self.getConfig("IAP_IOS_IS_SANDBOX") === "true") + const result: any = yield validateReceiptIos({ + receiptBody: { + "receipt-data": receipt, + password: self.getConfig("IAP_IOS_SHARED_SECRET"), + }, + isTest: self.getConfig("IAP_IOS_IS_SANDBOX") === "true", + }) if (result) { if (result.status === 0) { self.purchasedSKUs.add(SKU_COM_OICE_MEMBERSHIP) @@ -76,7 +83,7 @@ export const IAPStoreModel = types fetchProducts: flow(function * () { self.isFetchingProducts = true try { - self.products = yield RNIap.getProducts([SKU_COM_OICE_MEMBERSHIP]) + self.products = yield getProducts({ skus: [SKU_COM_OICE_MEMBERSHIP]}) } catch (error) { logError(error) } finally { @@ -85,7 +92,7 @@ export const IAPStoreModel = types }), requestSubscription: flow(function * (sku: string) { try { - yield RNIap.requestSubscription(sku, false) + yield requestSubscription({ sku }) } catch (error) { logError(error) } @@ -93,7 +100,7 @@ export const IAPStoreModel = types restorePurchases: flow(function * () { self.isRestoringPurchases = true try { - const purchases: Purchase[] = yield RNIap.getAvailablePurchases() + const purchases: Purchase[] = yield getAvailablePurchases() let hasSubscription = false purchases.forEach(purchase => { switch (purchase.productId) {