Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json
Expand Down Expand Up @@ -70,3 +67,10 @@ android/keystores/debug.keystore
lib/
.yarn/install-state.gz
example/.yarn/install-state.gz
example-0.73/.yarn/install-state.gz
example-0.79/.yarn/install-state.gz
example-0.83/.yarn/install-state.gz

google-services.json


33 changes: 19 additions & 14 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
buildscript {
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RNMovableInk_kotlinVersion"]

repositories {
google()
mavenCentral()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url 'https://central.sonatype.com/repository/maven-snapshots/'
}
}

dependencies {
classpath "com.android.tools.build:gradle:7.2.2"
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// AGP and Kotlin versions provided by the consuming app
}
Comment thread
chayelheinsen marked this conversation as resolved.
}

Expand All @@ -40,7 +35,6 @@ def supportsNamespace() {

apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: 'org.jetbrains.kotlin.android'

if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
Expand Down Expand Up @@ -70,22 +64,34 @@ android {
}
}

lintOptions {
lint {
disable "GradleCompatible"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
freeCompilerArgs += ["-Xskip-metadata-version-check"]
}

}

// Configure all Kotlin compile tasks to skip metadata version check
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += ["-Xskip-metadata-version-check"]
}
}

Comment thread
chayelheinsen marked this conversation as resolved.
Outdated
Comment thread
chayelheinsen marked this conversation as resolved.
Outdated
repositories {
mavenCentral()
google()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url 'https://central.sonatype.com/repository/maven-snapshots/'
}
}

Expand All @@ -97,9 +103,8 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.movableink.sdk:inked:2.2.0"
implementation "com.movableink.sdk:inked:2.3.0-SNAPSHOT"
Comment thread
chayelheinsen marked this conversation as resolved.
Outdated
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.7.0"
Comment thread
chayelheinsen marked this conversation as resolved.

}

if (isNewArchitectureEnabled()) {
Expand Down
6 changes: 3 additions & 3 deletions android/gradle.properties
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
Comment thread
chayelheinsen marked this conversation as resolved.
RNMovableInk_ndkversion=23.1.7779620
android.useAndroidX=true
53 changes: 33 additions & 20 deletions android/src/main/java/com/rnmovableink/RNMovableInkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -85,41 +86,53 @@ 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")
return
}
if (activity !is androidx.lifecycle.LifecycleOwner) {
Log.d("MISDK", "Activity is not a LifecycleOwner")
return
}
Comment on lines +89 to +101

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showInAppMessage now invokes the callback with strings like "Error: ..." when there is no activity / wrong activity type. The JS/TS contract treats the callback argument as a button ID, so passing error strings can make failures look like successful button taps. Consider surfacing failures via a separate error path (e.g., Promise reject, event, or a distinct error callback) and keep this callback reserved for actual button IDs.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inline with how the method already handles an exception, it invokes an string with "Error".

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)
}
Comment thread
chayelheinsen marked this conversation as resolved.
}
}
}
}

@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)
Comment thread
chayelheinsen marked this conversation as resolved.
Comment on lines +131 to +132

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handlePushNotificationOpenedWithContent is annotated with @ReactMethod but the body is commented out, so notifications opened in the example apps won’t be forwarded to the MovableInk SDK. Please convert the ReadableMap into the structure expected by MIClient.handlePushNotificationOpened(...) and invoke it (or remove the JS API until implemented).

Suggested change
// 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)

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

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.

}

fun ReadableArray.toStringList(): List<String> {
val stringList = mutableListOf<String>()
for (i in 0 until size()) {
stringList.add(getString(i))
getString(i)?.let { stringList.add(it) }
}
return stringList
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: "com.google.gms.google-services"

// import com.android.build.OutputFile

Expand Down Expand Up @@ -53,6 +54,14 @@ react {
// hermesFlags = ["-O", "-output-source-map"]
}

repositories {
google()
mavenCentral()
maven {
url 'https://central.sonatype.com/repository/maven-snapshots/'
}
}

/**
* Set this to true to create four separate APKs instead of one,
* one for each native architecture. This is useful if you don't
Expand Down Expand Up @@ -147,13 +156,29 @@ android {

// }
// }

kotlinOptions {
jvmTarget = "17"
freeCompilerArgs += ["-Xskip-metadata-version-check"]
}

packagingOptions {
resources {
excludes += ['META-INF/versions/9/OSGI-INF/MANIFEST.MF']
}
}
}

dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

// Firebase for push notifications
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation 'com.google.firebase:firebase-messaging'
implementation project(':react-native-notifications')

// debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
// debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name="com.movableink.MainApplication"
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name="com.movableink.MainActivity"
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.movableink
package com.movableink.app

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.movableink
package com.movableink.app

import android.app.Application
import com.facebook.react.PackageList
Expand All @@ -12,6 +12,7 @@ import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader
import com.rnmovableink.BuildConfig
import com.wix.reactnativenotifications.RNNotificationsPackage;
Comment thread
chayelheinsen marked this conversation as resolved.
Outdated

class MainApplication : Application(), ReactApplication {

Expand Down
34 changes: 34 additions & 0 deletions example-0.73/android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 24
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "25.1.8937393"
kotlinVersion = "1.9.24"
}
repositories {
google()
mavenCentral()
maven {
url 'https://central.sonatype.com/repository/maven-snapshots/'
}
}
dependencies {
classpath("com.android.tools.build:gradle:8.1.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("com.google.gms:google-services:4.4.0")
}
}

apply plugin: "com.facebook.react.rootproject"

// Disable tests for react-native-notifications due to deprecated API usage
project(':react-native-notifications') {
afterEvaluate {
tasks.withType(Test).configureEach {
enabled = false
}
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ rootProject.name = 'MovableInkExample'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
include ':react-native-notifications'
project(':react-native-notifications').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-notifications/lib/android/app')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#import <React/RCTBundleURLProvider.h>
#import <MovableInk/MovableInk-Swift.h>
#import <React/RCTLinkingManager.h>
#import "RNNotifications.h"

@implementation AppDelegate

Expand All @@ -13,6 +14,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};

[RNNotifications startMonitorNotifications];

return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

Expand All @@ -27,6 +30,19 @@ - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserAct
restorationHandler:restorationHandler];
}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSLog(@"Device Token: %@", deviceToken);
Comment thread
chayelheinsen marked this conversation as resolved.
Outdated
[RNNotifications didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
[RNNotifications didFailToRegisterForRemoteNotificationsWithError:error];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
[RNNotifications didReceiveBackgroundNotification:userInfo withCompletionHandler:completionHandler];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
Comment thread
chayelheinsen marked this conversation as resolved.
Outdated
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:mi-mobile-sandbox.mimobile.xyz</string>
Expand Down
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions example-0.73/ios/Pods/DoubleConversion/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading