@circle-fin/w3s-pw-react-native-sdk 1.1.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/BARE_REACT_NATIVE_GUIDE.md +397 -0
  2. package/LICENSE +1 -1
  3. package/README.md +196 -90
  4. package/android/build.gradle +43 -126
  5. package/android/src/main/AndroidManifest.xml +12 -16
  6. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/ProgrammablewalletRnSdkModule.kt +414 -244
  7. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseCallback.kt +76 -74
  8. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/RecordsHelper.kt +602 -0
  9. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/models/Records.kt +43 -0
  10. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnImageSetter.kt +55 -33
  11. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnLayoutProvider.kt +81 -79
  12. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnViewSetterProvider.kt +93 -63
  13. package/app.json +8 -0
  14. package/build/ProgrammablewalletRnSdkModule.d.ts +44 -0
  15. package/build/ProgrammablewalletRnSdkModule.d.ts.map +1 -0
  16. package/build/ProgrammablewalletRnSdkModule.js +21 -0
  17. package/build/ProgrammablewalletRnSdkModule.js.map +1 -0
  18. package/build/WalletSdk.d.ts +20 -0
  19. package/build/WalletSdk.d.ts.map +1 -0
  20. package/build/WalletSdk.js +303 -0
  21. package/build/WalletSdk.js.map +1 -0
  22. package/build/bridgeSafe.d.ts +50 -0
  23. package/build/bridgeSafe.d.ts.map +1 -0
  24. package/build/bridgeSafe.js +136 -0
  25. package/build/bridgeSafe.js.map +1 -0
  26. package/build/index.d.ts +21 -0
  27. package/build/index.d.ts.map +1 -0
  28. package/build/index.js +21 -0
  29. package/build/index.js.map +1 -0
  30. package/{lib/typescript/src → build}/types.d.ts +72 -43
  31. package/build/types.d.ts.map +1 -0
  32. package/build/types.js +331 -0
  33. package/build/types.js.map +1 -0
  34. package/build/utils/securityQuestionUtils.d.ts +43 -0
  35. package/build/utils/securityQuestionUtils.d.ts.map +1 -0
  36. package/build/utils/securityQuestionUtils.js +109 -0
  37. package/build/utils/securityQuestionUtils.js.map +1 -0
  38. package/expo-module.config.json +11 -0
  39. package/ios/Array+Extension.swift +17 -15
  40. package/ios/BridgeHelper.swift +71 -92
  41. package/ios/{RnWalletSdk+CustomizeAdapter.swift → CustomizeAdapter.swift} +19 -29
  42. package/ios/ProgrammablewalletRnSdk.podspec +30 -0
  43. package/ios/ProgrammablewalletRnSdkModule.swift +384 -0
  44. package/ios/TextConfig.swift +17 -15
  45. package/ios/TextKey.swift +17 -15
  46. package/ios/UIApplication+Extension.swift +26 -17
  47. package/ios/UIColor+Extension.swift +34 -28
  48. package/ios/UITextField+Extension.swift +31 -0
  49. package/ios/UIView+Extension.swift +24 -17
  50. package/package.json +70 -116
  51. package/plugins/apple-signin-entitlements.js +16 -0
  52. package/plugins/infoplist-config.js +77 -0
  53. package/plugins/infoplist-config.md +72 -0
  54. package/plugins/podfile-modifier.js +84 -0
  55. package/plugins/podfile-modifier.md +33 -0
  56. package/plugins/withCopyFiles.js +132 -0
  57. package/plugins/withCopyFiles.md +81 -0
  58. package/src/ProgrammablewalletRnSdkModule.ts +68 -38
  59. package/src/WalletSdk.ts +297 -159
  60. package/src/bridgeSafe.ts +156 -0
  61. package/src/index.ts +21 -0
  62. package/src/types.ts +133 -110
  63. package/src/utils/securityQuestionUtils.ts +121 -0
  64. package/COPYRIGHT +0 -10
  65. package/android/gradle.properties +0 -21
  66. package/android/src/main/AndroidManifestNew.xml +0 -22
  67. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/BridgeHelper.kt +0 -399
  68. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/ProgrammablewalletRnSdkPackage.kt +0 -49
  69. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseCallback2.kt +0 -65
  70. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseLogoutCallback.kt +0 -47
  71. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseSocialCallback.kt +0 -53
  72. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/TestHelper.kt +0 -37
  73. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/annotation/ExcludeFromGeneratedCCReport.kt +0 -33
  74. package/android/src/newarch/ProgrammablewalletRnSdkSpec.kt +0 -29
  75. package/android/src/oldarch/ProgrammablewalletRnSdkSpec.kt +0 -76
  76. package/circlefin-w3s-pw-react-native-sdk.podspec +0 -41
  77. package/ios/EventEmitter.swift +0 -49
  78. package/ios/ProgrammablewalletRnSdk.h +0 -29
  79. package/ios/ProgrammablewalletRnSdk.mm +0 -162
  80. package/ios/ReactNativeEventEmitter.m +0 -27
  81. package/ios/ReactNativeEventEmitter.swift +0 -37
  82. package/ios/RnWalletSdk.swift +0 -390
  83. package/ios/programmablewallet-rn-sdk-Bridging-Header.h +0 -22
  84. package/lib/commonjs/NativeProgrammablewalletRnSdk.js +0 -24
  85. package/lib/commonjs/NativeProgrammablewalletRnSdk.js.map +0 -1
  86. package/lib/commonjs/ProgrammablewalletRnSdkModule.js +0 -38
  87. package/lib/commonjs/ProgrammablewalletRnSdkModule.js.map +0 -1
  88. package/lib/commonjs/WalletSdk.js +0 -211
  89. package/lib/commonjs/WalletSdk.js.map +0 -1
  90. package/lib/commonjs/index.js +0 -74
  91. package/lib/commonjs/index.js.map +0 -1
  92. package/lib/commonjs/types.js +0 -342
  93. package/lib/commonjs/types.js.map +0 -1
  94. package/lib/module/NativeProgrammablewalletRnSdk.js +0 -19
  95. package/lib/module/NativeProgrammablewalletRnSdk.js.map +0 -1
  96. package/lib/module/ProgrammablewalletRnSdkModule.js +0 -31
  97. package/lib/module/ProgrammablewalletRnSdkModule.js.map +0 -1
  98. package/lib/module/WalletSdk.js +0 -203
  99. package/lib/module/WalletSdk.js.map +0 -1
  100. package/lib/module/index.js +0 -18
  101. package/lib/module/index.js.map +0 -1
  102. package/lib/module/types.js +0 -334
  103. package/lib/module/types.js.map +0 -1
  104. package/lib/typescript/src/NativeProgrammablewalletRnSdk.d.ts +0 -28
  105. package/lib/typescript/src/NativeProgrammablewalletRnSdk.d.ts.map +0 -1
  106. package/lib/typescript/src/ProgrammablewalletRnSdkModule.d.ts +0 -3
  107. package/lib/typescript/src/ProgrammablewalletRnSdkModule.d.ts.map +0 -1
  108. package/lib/typescript/src/WalletSdk.d.ts +0 -3
  109. package/lib/typescript/src/WalletSdk.d.ts.map +0 -1
  110. package/lib/typescript/src/index.d.ts +0 -4
  111. package/lib/typescript/src/index.d.ts.map +0 -1
  112. package/lib/typescript/src/types.d.ts.map +0 -1
  113. package/src/NativeProgrammablewalletRnSdk.ts +0 -77
  114. package/src/index.tsx +0 -29
@@ -1,18 +1,20 @@
1
- // Copyright (c) 2024, Circle Internet Financial, LTD. All rights reserved.
2
- //
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
1
+ /*
2
+ * Copyright 2025 Circle Internet Group, Inc. All rights reserved.
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
16
18
 
17
19
  import UIKit
18
20
 
@@ -32,10 +34,15 @@ extension UIView {
32
34
  func gradientColor(bounds: CGRect, gradientLayer: CAGradientLayer) -> UIColor? {
33
35
  guard bounds.width != 0, bounds.height != 0 else { return nil }
34
36
  UIGraphicsBeginImageContext(gradientLayer.bounds.size)
35
- gradientLayer.render(in: UIGraphicsGetCurrentContext()!)
37
+ guard let context = UIGraphicsGetCurrentContext() else {
38
+ UIGraphicsEndImageContext()
39
+ return nil
40
+ }
41
+ gradientLayer.render(in: context)
36
42
  let image = UIGraphicsGetImageFromCurrentImageContext()
37
43
  UIGraphicsEndImageContext()
38
- return UIColor(patternImage: image!)
44
+ guard let image = image else { return nil }
45
+ return UIColor(patternImage: image)
39
46
  }
40
47
 
41
48
  DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
package/package.json CHANGED
@@ -1,152 +1,106 @@
1
1
  {
2
2
  "name": "@circle-fin/w3s-pw-react-native-sdk",
3
- "version": "1.1.7",
3
+ "version": "2.0.0",
4
+ "packageManager": "yarn@1.22.22",
4
5
  "description": "React Native SDK for Circle Programmable Wallet",
5
- "main": "lib/commonjs/index",
6
- "module": "lib/module/index",
7
- "types": "lib/typescript/src/index.d.ts",
8
- "react-native": "src/index",
9
- "source": "src/index",
6
+ "main": "build/index.js",
7
+ "source": "src/index.ts",
8
+ "types": "build/index.d.ts",
10
9
  "files": [
11
- "src",
12
- "lib",
13
- "android",
10
+ "build",
11
+ "android/src",
12
+ "android/build.gradle",
14
13
  "ios",
15
- "*.podspec",
16
- "COPYRIGHT",
17
- "!ios/build",
18
- "!android/build",
19
- "!android/gradle",
20
- "!android/gradlew",
21
- "!android/gradlew.bat",
22
- "!android/local.properties",
14
+ "plugins",
15
+ "src",
16
+ "expo-module.config.json",
17
+ "app.json",
18
+ "README.md",
19
+ "BARE_REACT_NATIVE_GUIDE.md",
20
+ "!**/__test__",
23
21
  "!**/__tests__",
24
- "!**/__fixtures__",
25
22
  "!**/__mocks__",
26
- "!**/.*"
23
+ "!**/*.test.ts",
24
+ "!**/*.test.tsx",
25
+ "!android/build/",
26
+ "!android/.gradle/",
27
+ "!**/*.class"
27
28
  ],
28
29
  "scripts": {
29
- "example": "yarn workspace @circle-fin/w3s-pw-react-native-sdk-example",
30
- "test": "jest",
31
- "typecheck": "tsc --noEmit",
32
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
34
- "prepare": "bob build",
35
- "pod-install-new": "RCT_NEW_ARCH_ENABLED=1 bundle exec pod install",
36
- "publish:sdk": "npm publish --registry https://registry.npmjs.org/"
30
+ "build": "expo-module build",
31
+ "clean": "expo-module clean",
32
+ "lint": "expo-module lint",
33
+ "test": "expo-module test",
34
+ "test:ci": "jest --ci --watchAll=false --runInBand --passWithNoTests",
35
+ "prepare": "expo-module prepare",
36
+ "prepublishOnly": "expo-module prepublishOnly",
37
+ "expo-module": "expo-module",
38
+ "open:ios": "xed example/ios",
39
+ "open:android": "open -a \"Android Studio\" example/android",
40
+ "android": "expo run:android",
41
+ "ios": "expo run:ios",
42
+ "lint:raw": "eslint .",
43
+ "lint:fix": "eslint . --fix",
44
+ "format": "prettier --write .",
45
+ "format:check": "prettier --check .",
46
+ "check:type": "tsc --noEmit",
47
+ "publish:sdk": "npm publish --registry https://npm.pkg.github.com/"
37
48
  },
38
49
  "keywords": [
50
+ "react-native",
51
+ "expo",
52
+ "@circle-fin/w3s-pw-react-native-sdk",
39
53
  "circle",
40
54
  "circle.com",
41
55
  "usdc",
42
56
  "euroc",
43
57
  "stablecoins",
44
58
  "programmable wallets",
45
- "react-native",
46
59
  "rn",
47
60
  "ios",
48
61
  "android"
49
62
  ],
50
- "author": "Circle Internet Financial, LTD.",
51
- "license": "Apache-2.0",
63
+ "repository": "https://github.com/circlefin/w3s-react-native-sdk.git",
52
64
  "bugs": {
53
- "url": "https://github.com/circlefin/w3s-react-native-sdk/issues"
65
+ "url": "https://github.com/circlefin/w3s-react-native-sdk.git/issues"
54
66
  },
55
- "homepage": "https://github.com/circlefin/w3s-react-native-sdk#readme",
56
67
  "publishConfig": {
57
68
  "registry": "https://registry.npmjs.org/"
58
69
  },
70
+ "author": "Circle Internet Financial, LTD.",
71
+ "license": "Apache-2.0",
72
+ "homepage": "https://github.com/circlefin/w3s-react-native-sdk.git #readme",
59
73
  "devDependencies": {
60
- "@commitlint/config-conventional": "^17.0.2",
61
- "@evilmartians/lefthook": "^1.5.0",
62
- "@react-native-community/cli": "^18.0.0",
63
- "@react-native/eslint-config": "0.79.3",
64
- "@types/jest": "^29.5.13",
65
- "@types/react": "^19.0.0",
66
- "@typescript-eslint/eslint-plugin": "^5.30.5",
67
- "@typescript-eslint/parser": "^5.30.5",
68
- "commitlint": "^17.0.2",
69
- "del-cli": "^5.0.0",
70
- "eslint": "^8.19.0",
71
- "eslint-config-prettier": "^8.5.0",
72
- "eslint-plugin-prettier": "^4.0.0",
73
- "eslint-plugin-react": "^7.30.1",
74
- "jest": "^29.6.3",
75
- "pod-install": "^0.1.0",
76
- "prettier": "2.8.8",
77
- "react": "19.0.0",
74
+ "@babel/core": "^7.28.5",
75
+ "@expo/config-plugins": "~10.1.2",
76
+ "@types/jest": "^30.0.0",
77
+ "@types/react": "~19.0.0",
78
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
79
+ "@typescript-eslint/parser": "^8.38.0",
80
+ "eslint": "^9.26.0",
81
+ "eslint-config-prettier": "^10.1.8",
82
+ "eslint-plugin-react": "^7.37.5",
83
+ "eslint-plugin-react-native": "^5.0.0",
84
+ "expo": "~53.0.12",
85
+ "expo-module-scripts": "^4.1.6",
86
+ "expo-modules-core": "~2.4.2",
87
+ "jest": "^29.7.0",
88
+ "prettier": "^3.6.2",
89
+ "react": "^19.2.0",
78
90
  "react-native": "0.79.3",
79
- "react-native-builder-bob": "^0.20.0",
80
- "turbo": "^1.10.7",
81
- "typedoc": "^0.25.4",
82
- "typescript": "^5.0.4"
83
- },
84
- "resolutions": {
85
- "@types/react": "^18.2.0"
91
+ "react-test-renderer": "^19.2.0",
92
+ "ts-jest": "^29.4.5",
93
+ "typescript": "^5.9.3"
86
94
  },
87
95
  "peerDependencies": {
96
+ "expo": "*",
97
+ "expo-modules-core": "*",
88
98
  "react": "*",
89
99
  "react-native": "*"
90
100
  },
91
- "jest": {
92
- "preset": "react-native",
93
- "modulePathIgnorePatterns": [
94
- "<rootDir>/example/node_modules",
95
- "<rootDir>/lib/"
96
- ]
97
- },
98
- "commitlint": {
99
- "extends": [
100
- "@commitlint/config-conventional"
101
- ]
102
- },
103
- "eslintConfig": {
104
- "root": true,
105
- "extends": [
106
- "@react-native",
107
- "prettier"
108
- ],
109
- "rules": {
110
- "prettier/prettier": [
111
- "error",
112
- {
113
- "quoteProps": "consistent",
114
- "singleQuote": true,
115
- "tabWidth": 2,
116
- "trailingComma": "es5",
117
- "useTabs": false
118
- }
119
- ]
101
+ "peerDependenciesMeta": {
102
+ "expo": {
103
+ "optional": true
120
104
  }
121
- },
122
- "eslintIgnore": [
123
- "node_modules/",
124
- "lib/"
125
- ],
126
- "prettier": {
127
- "quoteProps": "consistent",
128
- "singleQuote": true,
129
- "tabWidth": 2,
130
- "trailingComma": "es5",
131
- "useTabs": false
132
- },
133
- "react-native-builder-bob": {
134
- "source": "src",
135
- "output": "lib",
136
- "targets": [
137
- "commonjs",
138
- "module",
139
- [
140
- "typescript",
141
- {
142
- "project": "tsconfig.build.json"
143
- }
144
- ]
145
- ]
146
- },
147
- "codegenConfig": {
148
- "name": "RNProgrammablewalletRnSdkSpec",
149
- "type": "modules",
150
- "jsSrcsDir": "src"
151
105
  }
152
106
  }
@@ -0,0 +1,16 @@
1
+ const { withEntitlementsPlist } = require('@expo/config-plugins')
2
+
3
+ /**
4
+ * Config plugin to ensure Apple Sign In entitlements are set
5
+ */
6
+ const withAppleSignInEntitlements = config => {
7
+ return withEntitlementsPlist(config, config => {
8
+ // Add Apple Sign In capability
9
+ config.modResults['com.apple.developer.applesignin'] = ['Default']
10
+
11
+ console.log('✅ Apple Sign In entitlements configured')
12
+ return config
13
+ })
14
+ }
15
+
16
+ module.exports = withAppleSignInEntitlements
@@ -0,0 +1,77 @@
1
+ const { withInfoPlist } = require('@expo/config-plugins')
2
+
3
+ /**
4
+ * Config plugin to set Info.plist values for Circle SDK
5
+ * Reads values from environment variables or options
6
+ */
7
+ const withInfoPlistConfig = (config, options = {}) => {
8
+ return withInfoPlist(config, config => {
9
+ const infoPlist = config.modResults
10
+
11
+ // Initialize CFBundleURLTypes if not exists
12
+ if (!infoPlist.CFBundleURLTypes) {
13
+ infoPlist.CFBundleURLTypes = []
14
+ }
15
+
16
+ // Facebook configuration
17
+ const facebookAppId = options.facebookAppId || process.env.IOS_FACEBOOK_APP_ID
18
+ if (facebookAppId) {
19
+ infoPlist.FacebookAppID = facebookAppId
20
+
21
+ // Add Facebook URL Scheme: fb{app-id}
22
+ const facebookUrlScheme = `fb${facebookAppId}`
23
+ const hasFacebookScheme = infoPlist.CFBundleURLTypes.some(urlType =>
24
+ urlType.CFBundleURLSchemes?.includes(facebookUrlScheme)
25
+ )
26
+
27
+ if (!hasFacebookScheme) {
28
+ infoPlist.CFBundleURLTypes.push({
29
+ CFBundleURLSchemes: [facebookUrlScheme]
30
+ })
31
+ console.log(`✅ Added Facebook URL Scheme: ${facebookUrlScheme}`)
32
+ }
33
+ }
34
+
35
+ if (options.facebookClientToken || process.env.IOS_FACEBOOK_CLIENT_TOKEN) {
36
+ infoPlist.FacebookClientToken =
37
+ options.facebookClientToken || process.env.IOS_FACEBOOK_CLIENT_TOKEN
38
+ }
39
+ if (options.facebookDisplayName || process.env.IOS_FACEBOOK_DISPLAY_NAME) {
40
+ infoPlist.FacebookDisplayName =
41
+ options.facebookDisplayName || process.env.IOS_FACEBOOK_DISPLAY_NAME
42
+ }
43
+
44
+ // Google configuration
45
+ const googleClientId = options.googleClientId || process.env.IOS_GOOGLE_CLIENT_ID
46
+ if (googleClientId) {
47
+ infoPlist.GIDClientID = googleClientId
48
+
49
+ // Add Google Reversed Client ID URL Scheme
50
+ // Convert: "123-abc.apps.googleusercontent.com" -> "com.googleusercontent.apps.123-abc"
51
+ const reversedClientId = googleClientId.split('.').reverse().join('.')
52
+
53
+ // Check if Google URL scheme already exists
54
+ const hasGoogleScheme = infoPlist.CFBundleURLTypes.some(urlType =>
55
+ urlType.CFBundleURLSchemes?.includes(reversedClientId)
56
+ )
57
+
58
+ if (!hasGoogleScheme) {
59
+ infoPlist.CFBundleURLTypes.push({
60
+ CFBundleURLSchemes: [reversedClientId]
61
+ })
62
+ console.log(`✅ Added Google Reversed Client ID URL Scheme: ${reversedClientId}`)
63
+ }
64
+ }
65
+
66
+ // Apple Sign In - No URL Scheme needed
67
+ // Apple Sign In uses entitlements only (handled by apple-signin-entitlements plugin)
68
+
69
+ // Face ID configuration (hard coded)
70
+ infoPlist.NSFaceIDUsageDescription = 'Enable Biometrics PIN'
71
+
72
+ console.log('✅ Info.plist configuration updated')
73
+ return config
74
+ })
75
+ }
76
+
77
+ module.exports = withInfoPlistConfig
@@ -0,0 +1,72 @@
1
+ # Info.plist Config Plugin
2
+
3
+ Config plugin to automatically set Info.plist values for Circle SDK, including Facebook and Google OAuth configuration.
4
+
5
+ ## Features
6
+
7
+ - Automatically set Facebook App ID, Client Token, and Display Name
8
+ - Configure Google Client ID
9
+ - Set Face ID usage description
10
+ - Support both environment variables and direct configuration
11
+
12
+ ## Usage
13
+
14
+ ### 1. Configure in app.json
15
+
16
+ ```json
17
+ {
18
+ "expo": {
19
+ "plugins": ["../plugins/infoplist-config"]
20
+ }
21
+ }
22
+ ```
23
+
24
+ ### 2. Set environment variables in .env
25
+
26
+ ```bash
27
+ IOS_FACEBOOK_APP_ID=your_facebook_app_id
28
+ IOS_FACEBOOK_CLIENT_TOKEN=your_facebook_client_token
29
+ IOS_FACEBOOK_DISPLAY_NAME=your_app_name
30
+ IOS_GOOGLE_CLIENT_ID=your_google_ios_client_id
31
+ ```
32
+
33
+ ### 3. Or pass options directly in app.json
34
+
35
+ ```json
36
+ {
37
+ "expo": {
38
+ "plugins": [
39
+ [
40
+ "../plugins/infoplist-config",
41
+ {
42
+ "facebookAppId": "YOUR_APP_ID",
43
+ "facebookClientToken": "YOUR_CLIENT_TOKEN",
44
+ "facebookDisplayName": "YOUR_APP_NAME",
45
+ "googleClientId": "YOUR_GOOGLE_CLIENT_ID"
46
+ }
47
+ ]
48
+ ]
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### 4. Run prebuild
54
+
55
+ ```bash
56
+ npm run prebuild
57
+ ```
58
+
59
+ ## Configuration Options
60
+
61
+ | Option | Environment Variable | Description |
62
+ | --------------------- | --------------------------- | ------------------------- |
63
+ | `facebookAppId` | `IOS_FACEBOOK_APP_ID` | Facebook App ID |
64
+ | `facebookClientToken` | `IOS_FACEBOOK_CLIENT_TOKEN` | Facebook Client Token |
65
+ | `facebookDisplayName` | `IOS_FACEBOOK_DISPLAY_NAME` | Facebook App Display Name |
66
+ | `googleClientId` | `IOS_GOOGLE_CLIENT_ID` | Google iOS Client ID |
67
+
68
+ ## Notes
69
+
70
+ - Environment variables take precedence over options
71
+ - All options are optional
72
+ - Face ID description is hard coded as "Enable Biometrics PIN"
@@ -0,0 +1,84 @@
1
+ const { withDangerousMod } = require('@expo/config-plugins')
2
+ const fs = require('fs/promises')
3
+ const path = require('path')
4
+
5
+ /**
6
+ * Simple Podfile modifier plugin for Circle SDK
7
+ */
8
+ const withPodfileModifier = (config, options = {}) => {
9
+ return withDangerousMod(config, [
10
+ 'ios',
11
+ async config => {
12
+ const podfilePath = path.join(
13
+ config.modRequest.platformProjectRoot,
14
+ 'Podfile',
15
+ )
16
+
17
+ try {
18
+ let content = await fs.readFile(podfilePath, 'utf8')
19
+
20
+ // Add Circle sources if not exists
21
+ if (!content.includes('github.com/circlefin/w3s-ios-sdk.git')) {
22
+ content =
23
+ `source 'https://github.com/circlefin/w3s-ios-sdk.git'\n` + content
24
+ }
25
+ if (!content.includes('github.com/CocoaPods/Specs.git')) {
26
+ content =
27
+ `source 'https://github.com/CocoaPods/Specs.git'\n` + content
28
+ }
29
+
30
+ // Add static frameworks with dynamic exceptions configuration
31
+ if (!content.includes('dynamic_frameworks')) {
32
+ const frameworksConfig = `
33
+ # Dynamic frameworks configuration
34
+ dynamic_frameworks = ['GoogleSignIn', 'FBSDKLoginKit', 'AppAuth', 'GTMAppAuth', 'GTMSessionFetcher']
35
+
36
+ pre_install do |installer|
37
+ installer.pod_targets.each do |target|
38
+ if dynamic_frameworks.include?(target.name)
39
+ def target.build_type
40
+ Pod::BuildType.dynamic_framework
41
+ end
42
+ end
43
+ end
44
+ end`
45
+
46
+ // Insert after target declaration
47
+ content = content.replace(
48
+ /(target ['"][^'"]*['"] do)/,
49
+ `$1${frameworksConfig}`,
50
+ )
51
+
52
+ // Find the last use_frameworks! line and add our static override after it
53
+ const useFrameworksRegex = /use_frameworks!.*\n/g
54
+ let lastMatch
55
+ let match
56
+ while ((match = useFrameworksRegex.exec(content)) !== null) {
57
+ lastMatch = match
58
+ }
59
+
60
+ if (lastMatch) {
61
+ const position = lastMatch.index + lastMatch[0].length
62
+ content =
63
+ content.slice(0, position) +
64
+ ' # Override to use static frameworks (added by Circle SDK plugin)\n' +
65
+ ' use_frameworks! :linkage => :static\n' +
66
+ content.slice(position)
67
+ }
68
+ }
69
+
70
+ await fs.writeFile(podfilePath, content, 'utf8')
71
+ console.log('✅ Podfile automatically modified')
72
+ } catch (error) {
73
+ if (error.code !== 'ENOENT') {
74
+ throw error
75
+ }
76
+ // Podfile doesn't exist, skip modification
77
+ }
78
+
79
+ return config
80
+ },
81
+ ])
82
+ }
83
+
84
+ module.exports = withPodfileModifier
@@ -0,0 +1,33 @@
1
+ # Podfile Modifier Plugin
2
+
3
+ Simple Expo plugin for automatically modifying Podfile during prebuild for Circle SDK.
4
+
5
+ ## Features
6
+
7
+ - Automatically add Circle iOS SDK source
8
+ - Configure dynamic frameworks (GoogleSignIn, FBSDKLoginKit, AppAuth, GTMAppAuth, GTMSessionFetcher)
9
+ - Add pre_install configuration
10
+
11
+ ## Usage
12
+
13
+ ### 1. Configure in app.json
14
+
15
+ ```json
16
+ {
17
+ "expo": {
18
+ "plugins": ["../plugins/podfile-modifier"]
19
+ }
20
+ }
21
+ ```
22
+
23
+ ### 2. Run prebuild
24
+
25
+ ```bash
26
+ npx expo prebuild --platform ios
27
+ ```
28
+
29
+ ## Notes
30
+
31
+ - Plugin automatically detects and avoids duplicate modifications
32
+ - Configuration is automatically applied on each prebuild
33
+ - Ensure plugin path is correct relative to app.json