reactnative-plugin-appice 1.7.33 → 1.7.35
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.
- package/android/build.gradle +4 -1
- package/android/src/main/java/com/appice/react/AppICEUtils.java +16 -0
- package/android/src/main/java/com/appice/react/AppIceReactPluginModule.java +174 -42
- package/campaign.js +6 -3
- package/example/App.js +1 -5
- package/example/android/.gradle/7.3.3/checksums/checksums.lock +0 -0
- package/example/android/.gradle/7.3.3/fileChanges/last-build.bin +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/fileHashes.lock +0 -0
- package/example/android/.gradle/7.3.3/gc.properties +0 -0
- package/example/android/.gradle/vcs-1/gc.properties +0 -0
- package/example/package.json +1 -1
- package/ios/AppIceReactPlugin.m +1 -2
- package/package.json +1 -1
- package/reactnative-plugin-appice.podspec +1 -1
- package/example/android/local.properties +0 -8
package/android/build.gradle
CHANGED
|
@@ -67,6 +67,9 @@ dependencies {
|
|
|
67
67
|
//google location
|
|
68
68
|
implementation "com.google.android.gms:play-services-location:21.0.1"
|
|
69
69
|
|
|
70
|
+
//google
|
|
71
|
+
implementation "com.google.android.gms:play-services-cloud-messaging:17.0.2"
|
|
72
|
+
|
|
70
73
|
//google legacy support
|
|
71
74
|
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
|
72
75
|
|
|
@@ -94,7 +97,7 @@ dependencies {
|
|
|
94
97
|
annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.3.1"
|
|
95
98
|
|
|
96
99
|
//appice
|
|
97
|
-
implementation "appice.io.android:sdk:2.6.
|
|
100
|
+
implementation "appice.io.android:sdk:2.6.33"
|
|
98
101
|
|
|
99
102
|
//glide
|
|
100
103
|
implementation "com.github.bumptech.glide:glide:4.11.0"
|
|
@@ -22,14 +22,18 @@ import java.util.ArrayList;
|
|
|
22
22
|
import java.util.Deque;
|
|
23
23
|
import java.util.HashMap;
|
|
24
24
|
import java.util.Iterator;
|
|
25
|
+
import java.util.List;
|
|
25
26
|
import java.util.Map;
|
|
26
27
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
27
28
|
|
|
29
|
+
import org.json.JSONArray;
|
|
28
30
|
import org.json.JSONObject;
|
|
29
31
|
|
|
30
32
|
import semusi.context.ui.appInbox.AppICEInboxMessage;
|
|
31
33
|
import semusi.context.utility.PushClickData;
|
|
34
|
+
import semusi.context.utility.Utility;
|
|
32
35
|
import semusi.model.campaign.Campaign;
|
|
36
|
+
import semusi.model.campaign.TransactionalCampaign;
|
|
33
37
|
import semusi.model.user.User;
|
|
34
38
|
|
|
35
39
|
|
|
@@ -451,7 +455,19 @@ public class AppICEUtils {
|
|
|
451
455
|
return jsonObject;
|
|
452
456
|
}
|
|
453
457
|
|
|
458
|
+
public static TransactionalCampaign toTransactionalCampaign(ReadableMap transactionalMap) {
|
|
459
|
+
if (transactionalMap == null) return null;
|
|
460
|
+
TransactionalCampaign transactionalCampaign = new TransactionalCampaign();
|
|
454
461
|
|
|
462
|
+
try {
|
|
463
|
+
JSONObject root = toJSONObject(transactionalMap);
|
|
464
|
+
transactionalCampaign.toTransactionalCampaign(root.toString());
|
|
465
|
+
return transactionalCampaign;
|
|
466
|
+
} catch (Throwable t) {
|
|
467
|
+
Utility.handleSDKException("toTransactionalCampaign", t);
|
|
468
|
+
return null;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
455
471
|
|
|
456
472
|
public static void printLog(String TAG, String message) {
|
|
457
473
|
System.out.println(TAG + ", " + message);
|
|
@@ -29,6 +29,7 @@ import semusi.context.ui.appInbox.AppICEInboxMessage;
|
|
|
29
29
|
import semusi.context.ui.appInbox.IAppICESuccessCallback;
|
|
30
30
|
import semusi.activitysdk.IAppICEDataCallback;
|
|
31
31
|
import semusi.model.campaign.Campaign;
|
|
32
|
+
import semusi.model.campaign.TransactionalCampaign;
|
|
32
33
|
import semusi.model.user.User;
|
|
33
34
|
|
|
34
35
|
import java.util.*;
|
|
@@ -643,48 +644,6 @@ public class AppIceReactPluginModule extends ReactContextBaseJavaModule {
|
|
|
643
644
|
}
|
|
644
645
|
}
|
|
645
646
|
|
|
646
|
-
@Nullable
|
|
647
|
-
@Override
|
|
648
|
-
public Map<String, Object> getConstants() {
|
|
649
|
-
final Map<String, Object> constants = new HashMap<>();
|
|
650
|
-
constants.put(EnumConstants.APPICE_USER_NAME.getConstants(), EnumConstants.APPICE_USER_NAME.getValue());
|
|
651
|
-
constants.put(EnumConstants.APPICE_USER_PHONE.getConstants(), EnumConstants.APPICE_USER_PHONE.getValue());
|
|
652
|
-
constants.put(EnumConstants.APPICE_USER_EMAIL.getConstants(), EnumConstants.APPICE_USER_EMAIL.getValue());
|
|
653
|
-
constants.put(EnumConstants.APPICE_DATE_OF_BIRTH.getConstants(), EnumConstants.APPICE_DATE_OF_BIRTH.getValue());
|
|
654
|
-
constants.put(EnumConstants.APPICE_USER_EDUCATION_TYPE.getConstants(), EnumConstants.APPICE_USER_EDUCATION_TYPE.getValue());
|
|
655
|
-
constants.put(EnumConstants.APPICE_USER_IS_EMPLOYED.getConstants(), EnumConstants.APPICE_USER_IS_EMPLOYED.getValue());
|
|
656
|
-
constants.put(EnumConstants.APPICE_USER_MARRIED.getConstants(), EnumConstants.APPICE_USER_MARRIED.getValue());
|
|
657
|
-
constants.put(EnumConstants.APPICE_USER_EDUCATION.getConstants(), EnumConstants.APPICE_USER_EDUCATION.getValue());
|
|
658
|
-
constants.put(EnumConstants.APPICE_USER_EMPLOYMENT_TYPE.getConstants(), EnumConstants.APPICE_USER_EMPLOYMENT_TYPE.getValue());
|
|
659
|
-
constants.put(EnumConstants.APPICE_USER_AGE.getConstants(), EnumConstants.APPICE_USER_AGE.getValue());
|
|
660
|
-
constants.put(EnumConstants.APPICE_USER_GENDER.getConstants(), EnumConstants.APPICE_USER_GENDER.getValue());
|
|
661
|
-
constants.put(EnumConstants.APPICE_PUSH_NOTIFICATION_CLICKED.getConstants(), EnumConstants.APPICE_PUSH_NOTIFICATION_CLICKED.getValue());
|
|
662
|
-
constants.put(EnumConstants.APPICE_INAPP_NOTIFICATION_CLICKED.getConstants(), EnumConstants.APPICE_INAPP_NOTIFICATION_CLICKED.getValue());
|
|
663
|
-
constants.put(EnumConstants.FIRST_SEEN.getConstants(), EnumConstants.FIRST_SEEN.getValue());
|
|
664
|
-
constants.put(EnumConstants.LAST_SEEN.getConstants(), EnumConstants.LAST_SEEN.getValue());
|
|
665
|
-
constants.put(EnumConstants.TOP_N_PRODUCTS_VIEWED.getConstants(), EnumConstants.TOP_N_PRODUCTS_VIEWED.getValue());
|
|
666
|
-
constants.put(EnumConstants.N_COMPLAINTS_RAISED.getConstants(), EnumConstants.N_COMPLAINTS_RAISED.getValue());
|
|
667
|
-
constants.put(EnumConstants.PREF_LOGIN_DEVICE.getConstants(), EnumConstants.PREF_LOGIN_DEVICE.getValue());
|
|
668
|
-
constants.put(EnumConstants.REFERRAL_CAMPAIGN.getConstants(), EnumConstants.REFERRAL_CAMPAIGN.getValue());
|
|
669
|
-
constants.put(EnumConstants.DEMOGRAPHIC_INFO.getConstants(), EnumConstants.DEMOGRAPHIC_INFO.getValue());
|
|
670
|
-
constants.put(EnumConstants.TOTAL_ORDER_VALUE.getConstants(), EnumConstants.TOTAL_ORDER_VALUE.getValue());
|
|
671
|
-
constants.put(EnumConstants.ADD_TO_CART_N_DAYS.getConstants(), EnumConstants.ADD_TO_CART_N_DAYS.getValue());
|
|
672
|
-
constants.put(EnumConstants.FINANCIAL_SERVICES.getConstants(), EnumConstants.FINANCIAL_SERVICES.getValue());
|
|
673
|
-
constants.put(EnumConstants.CREDIT_SCORE.getConstants(), EnumConstants.CREDIT_SCORE.getValue());
|
|
674
|
-
constants.put(EnumConstants.DEBT_TO_INCOME_RATIO.getConstants(), EnumConstants.DEBT_TO_INCOME_RATIO.getValue());
|
|
675
|
-
constants.put(EnumConstants.SAVINGS_BALANCE.getConstants(), EnumConstants.SAVINGS_BALANCE.getValue());
|
|
676
|
-
constants.put(EnumConstants.CHECKING_BALANCE.getConstants(), EnumConstants.CHECKING_BALANCE.getValue());
|
|
677
|
-
constants.put(EnumConstants.AVERAGE_TRANSACTION_AMOUNT.getConstants(), EnumConstants.AVERAGE_TRANSACTION_AMOUNT.getValue());
|
|
678
|
-
constants.put(EnumConstants.FREQUENCY_OF_TRANSACTION.getConstants(), EnumConstants.FREQUENCY_OF_TRANSACTION.getValue());
|
|
679
|
-
constants.put(EnumConstants.TYPE_OF_TRANSACTION.getConstants(), EnumConstants.TYPE_OF_TRANSACTION.getValue());
|
|
680
|
-
constants.put(EnumConstants.CAMP_ID.getConstants(), EnumConstants.CAMP_ID.getValue());
|
|
681
|
-
constants.put(EnumConstants.ACTION_URL.getConstants(), EnumConstants.ACTION_URL.getValue());
|
|
682
|
-
constants.put(EnumConstants.ACTION_TYPE.getConstants(), EnumConstants.ACTION_TYPE.getValue());
|
|
683
|
-
constants.put(EnumConstants.CUSTOMDATA.getConstants(), EnumConstants.CUSTOMDATA.getValue());
|
|
684
|
-
|
|
685
|
-
return constants;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
647
|
//=====================================
|
|
689
648
|
public static void sendEvent(String eventName, @Nullable WritableMap params) {
|
|
690
649
|
AppICEUtils.sendEventHelper(eventName, params, context);
|
|
@@ -775,4 +734,177 @@ public class AppIceReactPluginModule extends ReactContextBaseJavaModule {
|
|
|
775
734
|
Campaign campaign = ContextSdk.getCampaignById(cmpId, context);
|
|
776
735
|
callback.invoke(convertClassToWritableMap(campaign));
|
|
777
736
|
}
|
|
737
|
+
|
|
738
|
+
//================================================
|
|
739
|
+
// Language Setting
|
|
740
|
+
//================================================
|
|
741
|
+
|
|
742
|
+
@ReactMethod
|
|
743
|
+
public void setAppLanguage(String language) {
|
|
744
|
+
Context context = getReactApplicationContext();
|
|
745
|
+
ContextSdk.setAppLanguage(language,context);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
@ReactMethod
|
|
750
|
+
public void getAppLanguage(Callback callback) {
|
|
751
|
+
Context context = getReactApplicationContext();
|
|
752
|
+
String language = ContextSdk.getAppLanguage(context);
|
|
753
|
+
callback.invoke(language);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
@ReactMethod
|
|
757
|
+
public void setAppLanguageTopic(String language) {
|
|
758
|
+
Context context = getReactApplicationContext();
|
|
759
|
+
ContextSdk.setAppLanguageTopic(language, context);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
@ReactMethod
|
|
763
|
+
public void getAppLanguageTopic( Callback callback) {
|
|
764
|
+
Context context = getReactApplicationContext();
|
|
765
|
+
String appLanguageTopic = ContextSdk.getAppLanguageTopic(context);
|
|
766
|
+
callback.invoke(appLanguageTopic);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
@ReactMethod
|
|
770
|
+
public void getGlobalAppLanguageTopic( Callback callback) {
|
|
771
|
+
Context context = getReactApplicationContext();
|
|
772
|
+
String globalAppLanguage = ContextSdk.getGlobalAppLanguageTopic(context);
|
|
773
|
+
callback.invoke(globalAppLanguage);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
@ReactMethod
|
|
777
|
+
public void setDeviceLanguage(String language) {
|
|
778
|
+
Context context = getReactApplicationContext();
|
|
779
|
+
ContextSdk.setDeviceLanguage(language, context);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
@ReactMethod
|
|
783
|
+
public void getDeviceLanguage( Callback callback) {
|
|
784
|
+
Context context = getReactApplicationContext();
|
|
785
|
+
String deviceLanguage = ContextSdk.getDeviceLanguage(context);
|
|
786
|
+
callback.invoke(deviceLanguage);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
@ReactMethod
|
|
790
|
+
public void setDeviceLanguageTopic(String language) {
|
|
791
|
+
Context context = getReactApplicationContext();
|
|
792
|
+
ContextSdk.setDeviceLanguageTopic(language, context);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
public void getDeviceLanguageTopic( Callback callback) {
|
|
796
|
+
Context context = getReactApplicationContext();
|
|
797
|
+
String deviceLanguageTopic = ContextSdk.getDeviceLanguageTopic(context);
|
|
798
|
+
callback.invoke(deviceLanguageTopic);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
@ReactMethod
|
|
802
|
+
public void getGlobalDeviceLanguageTopic( Callback callback) {
|
|
803
|
+
Context context = getReactApplicationContext();
|
|
804
|
+
String globalDeviceLanguageTopic = ContextSdk.getGlobalDeviceLanguageTopic(context);
|
|
805
|
+
callback.invoke(globalDeviceLanguageTopic);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
@ReactMethod
|
|
809
|
+
public void setPlatformTopic(){
|
|
810
|
+
Context context = getReactApplicationContext();
|
|
811
|
+
ContextSdk.setPlatformTopic(context);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
@ReactMethod
|
|
815
|
+
public void getPlatformTopic( Callback callback){
|
|
816
|
+
Context context = getReactApplicationContext();
|
|
817
|
+
String platformTopic = ContextSdk.getPlatformTopic(context);
|
|
818
|
+
callback.invoke(platformTopic);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
@ReactMethod
|
|
822
|
+
public void getGlobalPlatformTopic( Callback callback){
|
|
823
|
+
Context context = getReactApplicationContext();
|
|
824
|
+
String globalPlatformTopic = ContextSdk.getGlobalPlatformTopic(context);
|
|
825
|
+
callback.invoke(globalPlatformTopic);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
@ReactMethod
|
|
829
|
+
public void setCustomTopic(String topic){
|
|
830
|
+
Context context = getReactApplicationContext();
|
|
831
|
+
ContextSdk.setCustomTopic(topic, context);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
@ReactMethod
|
|
835
|
+
public void removeCustomTopic(String topic){
|
|
836
|
+
Context context = getReactApplicationContext();
|
|
837
|
+
ContextSdk.removeCustomTopic(topic, context);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
@ReactMethod
|
|
841
|
+
public void getPlatformCustomTopic(String topic, Callback callback){
|
|
842
|
+
Context context = getReactApplicationContext();
|
|
843
|
+
String platformCustomTopic = ContextSdk.getPlatformCustomTopic(topic, context);
|
|
844
|
+
callback.invoke(platformCustomTopic);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
@ReactMethod
|
|
848
|
+
public void getGlobalCustomTopic(String topic, Callback callback){
|
|
849
|
+
Context context = getReactApplicationContext();
|
|
850
|
+
String globalCustomTopic = ContextSdk.getGlobalCustomTopic(topic, context);
|
|
851
|
+
callback.invoke(globalCustomTopic);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
@ReactMethod
|
|
855
|
+
public void getLanguageCustomTopic(String topic, Callback callback){
|
|
856
|
+
Context context = getReactApplicationContext();
|
|
857
|
+
String appICECustomTopic = ContextSdk.getLanguageCustomTopic(topic, context);
|
|
858
|
+
callback.invoke(appICECustomTopic);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
//================================================
|
|
862
|
+
@ReactMethod
|
|
863
|
+
public void scheduleTransactionalCampaign(ReadableMap trasanctionalMap){
|
|
864
|
+
Context context = getReactApplicationContext();
|
|
865
|
+
TransactionalCampaign transactionalCampaign = AppICEUtils.toTransactionalCampaign(trasanctionalMap);
|
|
866
|
+
ContextSdk.scheduleCampaign(transactionalCampaign, context);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
@Nullable
|
|
870
|
+
@Override
|
|
871
|
+
public Map<String, Object> getConstants() {
|
|
872
|
+
final Map<String, Object> constants = new HashMap<>();
|
|
873
|
+
constants.put(EnumConstants.APPICE_USER_NAME.getConstants(), EnumConstants.APPICE_USER_NAME.getValue());
|
|
874
|
+
constants.put(EnumConstants.APPICE_USER_PHONE.getConstants(), EnumConstants.APPICE_USER_PHONE.getValue());
|
|
875
|
+
constants.put(EnumConstants.APPICE_USER_EMAIL.getConstants(), EnumConstants.APPICE_USER_EMAIL.getValue());
|
|
876
|
+
constants.put(EnumConstants.APPICE_DATE_OF_BIRTH.getConstants(), EnumConstants.APPICE_DATE_OF_BIRTH.getValue());
|
|
877
|
+
constants.put(EnumConstants.APPICE_USER_EDUCATION_TYPE.getConstants(), EnumConstants.APPICE_USER_EDUCATION_TYPE.getValue());
|
|
878
|
+
constants.put(EnumConstants.APPICE_USER_IS_EMPLOYED.getConstants(), EnumConstants.APPICE_USER_IS_EMPLOYED.getValue());
|
|
879
|
+
constants.put(EnumConstants.APPICE_USER_MARRIED.getConstants(), EnumConstants.APPICE_USER_MARRIED.getValue());
|
|
880
|
+
constants.put(EnumConstants.APPICE_USER_EDUCATION.getConstants(), EnumConstants.APPICE_USER_EDUCATION.getValue());
|
|
881
|
+
constants.put(EnumConstants.APPICE_USER_EMPLOYMENT_TYPE.getConstants(), EnumConstants.APPICE_USER_EMPLOYMENT_TYPE.getValue());
|
|
882
|
+
constants.put(EnumConstants.APPICE_USER_AGE.getConstants(), EnumConstants.APPICE_USER_AGE.getValue());
|
|
883
|
+
constants.put(EnumConstants.APPICE_USER_GENDER.getConstants(), EnumConstants.APPICE_USER_GENDER.getValue());
|
|
884
|
+
constants.put(EnumConstants.APPICE_PUSH_NOTIFICATION_CLICKED.getConstants(), EnumConstants.APPICE_PUSH_NOTIFICATION_CLICKED.getValue());
|
|
885
|
+
constants.put(EnumConstants.APPICE_INAPP_NOTIFICATION_CLICKED.getConstants(), EnumConstants.APPICE_INAPP_NOTIFICATION_CLICKED.getValue());
|
|
886
|
+
constants.put(EnumConstants.FIRST_SEEN.getConstants(), EnumConstants.FIRST_SEEN.getValue());
|
|
887
|
+
constants.put(EnumConstants.LAST_SEEN.getConstants(), EnumConstants.LAST_SEEN.getValue());
|
|
888
|
+
constants.put(EnumConstants.TOP_N_PRODUCTS_VIEWED.getConstants(), EnumConstants.TOP_N_PRODUCTS_VIEWED.getValue());
|
|
889
|
+
constants.put(EnumConstants.N_COMPLAINTS_RAISED.getConstants(), EnumConstants.N_COMPLAINTS_RAISED.getValue());
|
|
890
|
+
constants.put(EnumConstants.PREF_LOGIN_DEVICE.getConstants(), EnumConstants.PREF_LOGIN_DEVICE.getValue());
|
|
891
|
+
constants.put(EnumConstants.REFERRAL_CAMPAIGN.getConstants(), EnumConstants.REFERRAL_CAMPAIGN.getValue());
|
|
892
|
+
constants.put(EnumConstants.DEMOGRAPHIC_INFO.getConstants(), EnumConstants.DEMOGRAPHIC_INFO.getValue());
|
|
893
|
+
constants.put(EnumConstants.TOTAL_ORDER_VALUE.getConstants(), EnumConstants.TOTAL_ORDER_VALUE.getValue());
|
|
894
|
+
constants.put(EnumConstants.ADD_TO_CART_N_DAYS.getConstants(), EnumConstants.ADD_TO_CART_N_DAYS.getValue());
|
|
895
|
+
constants.put(EnumConstants.FINANCIAL_SERVICES.getConstants(), EnumConstants.FINANCIAL_SERVICES.getValue());
|
|
896
|
+
constants.put(EnumConstants.CREDIT_SCORE.getConstants(), EnumConstants.CREDIT_SCORE.getValue());
|
|
897
|
+
constants.put(EnumConstants.DEBT_TO_INCOME_RATIO.getConstants(), EnumConstants.DEBT_TO_INCOME_RATIO.getValue());
|
|
898
|
+
constants.put(EnumConstants.SAVINGS_BALANCE.getConstants(), EnumConstants.SAVINGS_BALANCE.getValue());
|
|
899
|
+
constants.put(EnumConstants.CHECKING_BALANCE.getConstants(), EnumConstants.CHECKING_BALANCE.getValue());
|
|
900
|
+
constants.put(EnumConstants.AVERAGE_TRANSACTION_AMOUNT.getConstants(), EnumConstants.AVERAGE_TRANSACTION_AMOUNT.getValue());
|
|
901
|
+
constants.put(EnumConstants.FREQUENCY_OF_TRANSACTION.getConstants(), EnumConstants.FREQUENCY_OF_TRANSACTION.getValue());
|
|
902
|
+
constants.put(EnumConstants.TYPE_OF_TRANSACTION.getConstants(), EnumConstants.TYPE_OF_TRANSACTION.getValue());
|
|
903
|
+
constants.put(EnumConstants.CAMP_ID.getConstants(), EnumConstants.CAMP_ID.getValue());
|
|
904
|
+
constants.put(EnumConstants.ACTION_URL.getConstants(), EnumConstants.ACTION_URL.getValue());
|
|
905
|
+
constants.put(EnumConstants.ACTION_TYPE.getConstants(), EnumConstants.ACTION_TYPE.getValue());
|
|
906
|
+
constants.put(EnumConstants.CUSTOMDATA.getConstants(), EnumConstants.CUSTOMDATA.getValue());
|
|
907
|
+
|
|
908
|
+
return constants;
|
|
909
|
+
}
|
|
778
910
|
}
|
package/campaign.js
CHANGED
|
@@ -15,8 +15,11 @@ const handleClickOnPush = async (campaign) => {
|
|
|
15
15
|
if (httpUrls) {
|
|
16
16
|
try {
|
|
17
17
|
if (Platform.OS === 'ios') {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const supported = await Linking.canOpenURL(url);
|
|
19
|
+
if (!supported) {
|
|
20
|
+
console.log('URL not supported on iOS:', url);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
await Linking.openURL(url);
|
|
@@ -27,7 +30,7 @@ const handleClickOnPush = async (campaign) => {
|
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
if (actionType === 'dl' && !httpUrls) {
|
|
30
|
-
|
|
33
|
+
// handle custom deeplink
|
|
31
34
|
}
|
|
32
35
|
};
|
|
33
36
|
|
package/example/App.js
CHANGED
|
@@ -98,11 +98,7 @@ function addAppICEAPIListeners() {
|
|
|
98
98
|
|
|
99
99
|
try {
|
|
100
100
|
const campaign = new Campaign(event.AppICEPushNotificationClicked);
|
|
101
|
-
|
|
102
|
-
if (result) {
|
|
103
|
-
console.log("Returned campaign:", result);
|
|
104
|
-
// Use result here (e.g., for DL handling)
|
|
105
|
-
}
|
|
101
|
+
await handleClickOnPush(campaign);
|
|
106
102
|
} catch (error) {
|
|
107
103
|
console.error('Error handling app link:', error);
|
|
108
104
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
package/example/package.json
CHANGED
package/ios/AppIceReactPlugin.m
CHANGED
|
@@ -185,8 +185,7 @@ RCT_EXPORT_METHOD(getUserId:(RCTResponseSenderBlock)callback)
|
|
|
185
185
|
|
|
186
186
|
RCT_EXPORT_METHOD(pushNotificationClicked:(NSDictionary*)userInfo)
|
|
187
187
|
{
|
|
188
|
-
|
|
189
|
-
//[[appICE sharedInstance] pushNotificationClickedEvent:userInfo];
|
|
188
|
+
[[appICE sharedInstance] pushNotificationClickedEvent:userInfo];
|
|
190
189
|
}
|
|
191
190
|
|
|
192
191
|
RCT_EXPORT_METHOD(setUser:(NSDictionary*)userProfile)
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
-
# as it contains information specific to your local configuration.
|
|
3
|
-
#
|
|
4
|
-
# Location of the SDK. This is only used by Gradle.
|
|
5
|
-
# For customization when using a Version Control System, please read the
|
|
6
|
-
# header note.
|
|
7
|
-
#Tue Nov 28 00:45:30 IST 2023
|
|
8
|
-
sdk.dir=/Users/amit/Library/Android/sdk
|