-
Notifications
You must be signed in to change notification settings - Fork 21
No codes #351
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
Merged
Merged
No codes #351
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5741934
Added nocodes part
actions-user cbd3566
Updated example
actions-user 414a4e6
Added part of android fixes
actions-user fad2fa6
Buildable Android version
SpertsyanKM 5b5e625
Updated logic
actions-user f47cf07
No-Code events handling for Android
SpertsyanKM 24370ea
No-Code errors serialization fixes
SpertsyanKM 862d80e
Screen presentation config fixes
SpertsyanKM eef4b53
closeAll action fix on Android
SpertsyanKM 78527ed
Remove logging
SpertsyanKM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,8 @@ buck-out/ | |
*.keystore | ||
|
||
# vscode | ||
.vscode | ||
.vscode | ||
|
||
# CocoaPods | ||
Pods/ | ||
Podfile.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#Wed Jun 18 14:18:27 MSK 2025 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
137 changes: 0 additions & 137 deletions
137
android/src/main/java/com/reactlibrary/AutomationsModule.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package com.reactlibrary; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.facebook.react.bridge.Promise; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
import com.facebook.react.bridge.ReactMethod; | ||
import com.facebook.react.bridge.ReadableMap; | ||
import com.facebook.react.bridge.WritableMap; | ||
import com.facebook.react.bridge.Arguments; | ||
import com.facebook.react.modules.core.DeviceEventManagerModule; | ||
import com.facebook.react.module.annotations.ReactModule; | ||
import io.qonversion.sandwich.NoCodesSandwich; | ||
import io.qonversion.sandwich.NoCodesEventListener; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class NoCodesModule extends ReactContextBaseJavaModule { | ||
private final ReactApplicationContext reactContext; | ||
private final NoCodesSandwich noCodesSandwich; | ||
private final NoCodesEventListener noCodesEventListener; | ||
private DeviceEventManagerModule.RCTDeviceEventEmitter eventEmitter = null; | ||
|
||
public NoCodesModule(ReactApplicationContext reactContext) { | ||
super(reactContext); | ||
this.reactContext = reactContext; | ||
this.noCodesSandwich = new NoCodesSandwich(); | ||
|
||
this.noCodesEventListener = (event, payload) -> { | ||
WritableMap payloadMap = null; | ||
if (payload != null) { | ||
payloadMap = EntitiesConverter.convertMapToWritableMap(payload); | ||
} | ||
|
||
sendEvent(event.getKey(), payloadMap); | ||
}; | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
super.initialize(); | ||
|
||
eventEmitter = getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return "RNNoCodes"; | ||
} | ||
|
||
@ReactMethod | ||
public void initialize(String projectKey) { | ||
noCodesSandwich.initialize(reactContext, projectKey, null, null, null); | ||
noCodesSandwich.setDelegate(noCodesEventListener); | ||
noCodesSandwich.setScreenCustomizationDelegate(); | ||
} | ||
|
||
@ReactMethod | ||
public void setScreenPresentationConfig(ReadableMap configData, String contextKey, final Promise promise) { | ||
try { | ||
Map<String, Object> config = EntitiesConverter.convertReadableMapToHashMap(configData); | ||
noCodesSandwich.setScreenPresentationConfig(config, contextKey); | ||
Utils.resolveWithSuccess(promise); | ||
} catch (Exception e) { | ||
promise.reject(e); | ||
} | ||
} | ||
|
||
@ReactMethod | ||
public void showScreen(String contextKey, final Promise promise) { | ||
try { | ||
noCodesSandwich.showScreen(contextKey); | ||
Utils.resolveWithSuccess(promise); | ||
} catch (Exception e) { | ||
promise.reject(e); | ||
} | ||
} | ||
|
||
@ReactMethod | ||
public void close(final Promise promise) { | ||
try { | ||
noCodesSandwich.close(); | ||
Utils.resolveWithSuccess(promise); | ||
} catch (Exception e) { | ||
promise.reject(e); | ||
} | ||
} | ||
|
||
private void sendEvent(String eventName, WritableMap params) { | ||
if (eventEmitter != null) { | ||
eventEmitter.emit(eventName, params); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.