-
Notifications
You must be signed in to change notification settings - Fork 0
React Native 0.73 0.79 0.83 Example Apps [sc-185996] #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b7f1dda
23c8eb5
2499552
6cac9ad
6b6b183
924bb84
fc9c4ac
1006812
ed3d646
15c8d6f
274f240
a1e3f18
98f6072
748d5cd
d861c6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| RNMovableInk_kotlinVersion=1.8.0 | ||
| RNMovableInk_kotlinVersion=2.2.0 | ||
| RNMovableInk_minSdkVersion=24 | ||
| RNMovableInk_targetSdkVersion=33 | ||
| RNMovableInk_compileSdkVersion=33 | ||
| RNMovableInk_targetSdkVersion=34 | ||
| RNMovableInk_compileSdkVersion=34 | ||
chayelheinsen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| RNMovableInk_ndkversion=23.1.7779620 | ||
| android.useAndroidX=true | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ import com.movableink.inked.inAppMessage.MovableInAppClient | |||||||||
| import androidx.lifecycle.LifecycleOwner | ||||||||||
| import androidx.lifecycle.lifecycleScope | ||||||||||
| import kotlinx.coroutines.launch | ||||||||||
| import android.util.Log | ||||||||||
|
|
||||||||||
| class RNMovableInkModule(reactContext: ReactApplicationContext) : | ||||||||||
| ReactContextBaseJavaModule(reactContext) { | ||||||||||
|
|
@@ -85,41 +86,56 @@ class RNMovableInkModule(reactContext: ReactApplicationContext) : | |||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| @ReactMethod | ||||||||||
| fun showInAppMessage(url: String, callback: Callback) { | ||||||||||
| val activity = currentActivity | ||||||||||
| if (activity is androidx.lifecycle.LifecycleOwner) { | ||||||||||
| activity.lifecycleScope.launch { | ||||||||||
| try { | ||||||||||
| MIClient.showInAppBrowser( | ||||||||||
| activity, | ||||||||||
| url, | ||||||||||
| listener = object : MovableInAppClient.OnUrlLoadingListener { | ||||||||||
| override fun onButtonClicked(value: String) { | ||||||||||
| activity.runOnUiThread { | ||||||||||
| callback.invoke(value) | ||||||||||
| } | ||||||||||
| @ReactMethod | ||||||||||
| fun showInAppMessage(url: String, callback: Callback) { | ||||||||||
| val activity = reactApplicationContext.currentActivity | ||||||||||
| if (activity == null) { | ||||||||||
| Log.d("MISDK", "No current activity") | ||||||||||
| callback.invoke("Error: No current activity") | ||||||||||
| return | ||||||||||
| } | ||||||||||
| if (activity !is androidx.lifecycle.LifecycleOwner) { | ||||||||||
| Log.d("MISDK", "Activity is not a LifecycleOwner") | ||||||||||
| callback.invoke("Error: Activity is not a LifecycleOwner") | ||||||||||
| return | ||||||||||
| } | ||||||||||
|
Comment on lines
+89
to
+101
|
||||||||||
| activity.lifecycleScope.launch { | ||||||||||
| try { | ||||||||||
| MIClient.showInAppBrowser( | ||||||||||
| activity, | ||||||||||
| url, | ||||||||||
| listener = object : MovableInAppClient.OnUrlLoadingListener { | ||||||||||
| override fun onButtonClicked(value: String) { | ||||||||||
| (activity as? android.app.Activity)?.runOnUiThread { | ||||||||||
| callback.invoke(value) | ||||||||||
| } | ||||||||||
| } | ||||||||||
| ) | ||||||||||
| } catch (e: Exception) { | ||||||||||
| activity.runOnUiThread { | ||||||||||
| callback.invoke("Error: ${e.message}") | ||||||||||
| } | ||||||||||
| ) | ||||||||||
| } catch (e: Exception) { | ||||||||||
| (activity as? android.app.Activity)?.runOnUiThread { | ||||||||||
| Log.e("MISDK", "Error showing in-app message", e) | ||||||||||
| callback.invoke("Error: ${e.message}") | ||||||||||
| } | ||||||||||
| } | ||||||||||
| } | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| @ReactMethod | ||||||||||
| fun setValidPasteboardValues(values: ReadableArray) { | ||||||||||
| MIClient.validPasteboardValues(values.toStringList()) | ||||||||||
| } | ||||||||||
|
|
||||||||||
| @ReactMethod | ||||||||||
| fun handlePushNotificationOpenedWithContent(properties: ReadableMap) { | ||||||||||
| // val map: Map<String, String> = properties.toHashMap().mapValues { it.value.toString() } | ||||||||||
| // MIClient.handlePushNotificationOpened(map) | ||||||||||
chayelheinsen marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+131
to
+132
|
||||||||||
| // val map: Map<String, String> = properties.toHashMap().mapValues { it.value.toString() } | |
| // MIClient.handlePushNotificationOpened(map) | |
| val map: Map<String, String> = properties.toHashMap().mapValues { it.value.toString() } | |
| MIClient.handlePushNotificationOpened(map) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be enabled when we go to release this - since the only build that has this is a snapshot.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| module.exports = { | ||
| root: true, | ||
| extends: '@react-native', | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # OSX | ||
| # | ||
| .DS_Store | ||
|
|
||
| # Xcode | ||
| # | ||
| build/ | ||
| *.pbxuser | ||
| !default.pbxuser | ||
| *.mode1v3 | ||
| !default.mode1v3 | ||
| *.mode2v3 | ||
| !default.mode2v3 | ||
| *.perspectivev3 | ||
| !default.perspectivev3 | ||
| xcuserdata | ||
| *.xccheckout | ||
| *.moved-aside | ||
| DerivedData | ||
| *.hmap | ||
| *.ipa | ||
| *.xcuserstate | ||
| **/.xcode.env.local | ||
|
|
||
| # Android/IntelliJ | ||
| # | ||
| build/ | ||
| .idea | ||
| .gradle | ||
| local.properties | ||
| *.iml | ||
| *.hprof | ||
| .cxx/ | ||
| *.keystore | ||
| !debug.keystore | ||
| .kotlin/ | ||
|
|
||
| # node.js | ||
| # | ||
| node_modules/ | ||
| npm-debug.log | ||
| yarn-error.log | ||
|
|
||
| # fastlane | ||
| # | ||
| # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the | ||
| # screenshots whenever they are needed. | ||
| # For more information about the recommended setup visit: | ||
| # https://docs.fastlane.tools/best-practices/source-control/ | ||
|
|
||
| **/fastlane/report.xml | ||
| **/fastlane/Preview.html | ||
| **/fastlane/screenshots | ||
| **/fastlane/test_output | ||
|
|
||
| # Bundle artifact | ||
| *.jsbundle | ||
|
|
||
| # Ruby / CocoaPods | ||
| **/Pods/ | ||
| /vendor/bundle/ | ||
|
|
||
| # Temporary files created by Metro to check the health of the file watcher | ||
| .metro-health-check* | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # Yarn | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/sdks | ||
| !.yarn/versions |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| module.exports = { | ||
| arrowParens: 'avoid', | ||
| bracketSameLine: true, | ||
| bracketSpacing: false, | ||
| singleQuote: true, | ||
| trailingComma: 'all', | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| yarnPath: .yarn/releases/yarn-4.5.1.cjs | ||
| enableGlobalCache: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| source 'https://rubygems.org' | ||
|
|
||
| # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version | ||
| ruby ">= 2.6.10" | ||
|
|
||
| # Exclude problematic versions of cocoapods and activesupport that causes build failures. | ||
| gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' | ||
| gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' | ||
| gem 'xcodeproj', '< 1.26.0' | ||
| gem 'CFPropertyList', '= 3.0.7' | ||
| gem 'concurrent-ruby', '< 1.3.4' | ||
|
|
||
| # Ruby 3.4.0 has removed some libraries from the standard library. | ||
| gem 'bigdecimal' | ||
| gem 'logger' | ||
| gem 'benchmark' | ||
| gem 'mutex_m' |
Uh oh!
There was an error while loading. Please reload this page.