reactnative-plugin-appice 1.4.0 → 1.4.3
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/README.md +1 -59
- package/android/build.gradle +14 -54
- package/android/libs/logutility.jar +0 -0
- package/android/local.properties +2 -2
- package/android/src/main/AndroidManifest.xml +21 -124
- package/android/src/main/java/com/reactlibrary/AppICEUtils.java +38 -0
- package/android/src/main/java/com/reactlibrary/AppIceReactPluginModule.java +330 -78
- package/android/src/main/java/com/reactlibrary/CampaignCampsReceiver.java +20 -3
- package/android/src/main/java/com/reactlibrary/InAppWebView.java +68 -0
- package/android/src/main/java/com/reactlibrary/NotificationEventService.java +0 -0
- package/android/src/main/java/com/reactlibrary/React-Native workspace.code-workspace +29 -0
- package/example/App.js +126 -0
- package/example/Gemfile +6 -0
- package/example/__tests__/App-test.js +14 -0
- package/example/android/.gradle/7.3.3/checksums/checksums.lock +0 -0
- package/{android/.gradle/5.4.1/fileHashes/fileHashes.bin → example/android/.gradle/7.3.3/checksums/md5-checksums.bin} +0 -0
- package/example/android/.gradle/7.3.3/checksums/sha1-checksums.bin +0 -0
- package/example/android/.gradle/7.3.3/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/{android/.gradle/5.4.1 → example/android/.gradle/7.3.3/dependencies-accessors}/gc.properties +0 -0
- package/example/android/.gradle/7.3.3/executionHistory/executionHistory.lock +0 -0
- package/{android/.gradle/5.4.1 → example/android/.gradle/7.3.3}/fileChanges/last-build.bin +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/fileHashes.bin +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/fileHashes.lock +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/resourceHashesCache.bin +0 -0
- package/{android/.gradle/vcs-1 → example/android/.gradle/7.3.3}/gc.properties +0 -0
- package/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/example/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/example/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/example/android/.gradle/vcs-1/gc.properties +0 -0
- package/example/android/.idea/.name +1 -0
- package/example/android/.idea/compiler.xml +6 -0
- package/example/android/.idea/gradle.xml +34 -0
- package/example/android/.idea/jarRepositories.xml +55 -0
- package/example/android/.idea/misc.xml +10 -0
- package/example/android/.idea/vcs.xml +6 -0
- package/example/android/app/_BUCK +55 -0
- package/example/android/app/build.gradle +321 -0
- package/example/android/app/build_defs.bzl +19 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/google-services.json +275 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/debug/AndroidManifest.xml +13 -0
- package/example/android/app/src/debug/java/com/example/ReactNativeFlipper.java +73 -0
- package/example/android/app/src/main/AndroidManifest.xml +72 -0
- package/example/android/app/src/main/java/com/example/MainActivity.java +48 -0
- package/example/android/app/src/main/java/com/example/MainApplication.java +91 -0
- package/example/android/app/src/main/java/com/example/newarchitecture/MainApplicationReactNativeHost.java +116 -0
- package/example/android/app/src/main/java/com/example/newarchitecture/components/MainComponentsRegistry.java +36 -0
- package/example/android/app/src/main/java/com/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -0
- package/example/android/app/src/main/jni/Android.mk +48 -0
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +24 -0
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -0
- package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +61 -0
- package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -0
- package/example/android/app/src/main/jni/OnLoad.cpp +11 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/build.gradle +54 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/example/android/gradle.properties +40 -0
- package/example/android/gradlew +234 -0
- package/example/android/gradlew.bat +89 -0
- package/example/android/local.properties +8 -0
- package/example/android/settings.gradle +11 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +3 -0
- package/example/index.js +9 -0
- package/example/ios/Podfile +44 -0
- package/example/ios/Podfile.lock +561 -0
- package/example/ios/_xcode.env +11 -0
- package/example/ios/example/AppDelegate.h +8 -0
- package/example/ios/example/AppDelegate.mm +174 -0
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/ios/example/Images.xcassets/Contents.json +6 -0
- package/example/ios/example/Info.plist +62 -0
- package/example/ios/example/LaunchScreen.storyboard +47 -0
- package/example/ios/example/example.entitlements +8 -0
- package/example/ios/example/main.m +10 -0
- package/example/ios/example.xcodeproj/project.pbxproj +712 -0
- package/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +88 -0
- package/example/ios/example.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/example/ios/exampleTests/Info.plist +24 -0
- package/example/ios/exampleTests/exampleTests.m +66 -0
- package/example/metro.config.js +17 -0
- package/example/package-lock.json +22484 -0
- package/example/package.json +34 -0
- package/example/yarn.lock +7604 -0
- package/index.js +107 -3
- package/ios/AppICEReactEvent.h +22 -0
- package/ios/AppICEReactEvent.m +65 -0
- package/ios/AppICESDK/appICE.momd/VersionInfo.plist +0 -0
- package/ios/AppICESDK/appICE.momd/appICE 4.mom +0 -0
- package/ios/AppICESDK/appICE.momd/appICE 4.omo +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/APPChildViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/HAlfFooterNOTINAppViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/HAlfHeaderINAppViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/HAlfINAppViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/objects-11.0+.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/runtime.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/Info.plist +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/RatingViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/SurveyViewController.nib +0 -0
- package/ios/AppICESDK/include/iosAppiceSDK/AppICEHelper.h +77 -0
- package/ios/AppICESDK/include/iosAppiceSDK/AppICEInboxMessage.h +1 -0
- package/ios/AppICESDK/include/iosAppiceSDK/AppICEJSInterface.h +21 -0
- package/ios/AppICESDK/include/iosAppiceSDK/appICE.h +68 -22
- package/ios/AppICESDK/include/iosAppiceSDK/appICEUserDetails.h +6 -0
- package/ios/AppICESDK/include/iosAppiceSDK/isrgrootx1.der +0 -0
- package/ios/AppICESDK/include/iosAppiceSDK/lets-encrypt-r3.der +0 -0
- package/ios/AppICESDK/{libiosAppiceSDK_v1.7.15.a → libiosAppiceSDK_v1.7.37.a} +0 -0
- package/ios/AppIceReactPlugin.h +16 -2
- package/ios/AppIceReactPlugin.m +96 -13
- package/ios/AppIceReactPlugin.xcodeproj/project.pbxproj +67 -55
- package/package.json +3 -2
- package/android/.gradle/5.4.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/5.4.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/5.4.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.idea/caches/build_file_checksums.ser +0 -0
- package/android/.idea/caches/gradle_models.ser +0 -0
- package/android/.idea/codeStyles/Project.xml +0 -116
- package/android/.idea/dictionaries/Adi.xml +0 -3
- package/android/.idea/gradle.xml +0 -16
- package/android/.idea/libraries/Gradle____local_aars____Users_Adi_ReactModule_AppICEReactLibrary_android_libs_AppICE_SDK_v2_4_18_jar_unspecified_jar.xml +0 -9
- package/android/.idea/libraries/Gradle____local_aars____Users_Adi_ReactModule_AppICEReactLibrary_android_libs_logutility_jar_unspecified_jar.xml +0 -9
- package/android/.idea/libraries/Gradle__android_arch_core_common_1_0_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_0_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_appcompat_v7_23_0_1_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_android_support_customtabs_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_recyclerview_v7_23_0_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_annotations_23_0_1_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_android_support_support_annotations_26_1_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_android_support_support_compat_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_core_ui_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_core_utils_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_fragment_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_media_compat_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_android_support_support_v4_23_0_1_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__com_android_support_support_v4_26_1_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp_0_8_1_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_20_1_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_2_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_okhttp_1_2_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_2_3_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_base_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_identifier_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_lite_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_base_16_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_basement_16_2_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_gass_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_location_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_api_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_base_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_impl_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_sdk_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_sdk_api_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_places_placereport_16_0_0_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_stats_16_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_tasks_16_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_auto_value_auto_value_annotations_1_6_3_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_analytics_16_5_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_common_17_0_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_core_16_0_9_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_iid_18_0_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_iid_interop_16_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_measurement_connector_17_0_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_firebase_firebase_messaging_18_0_0_aar.xml +0 -12
- package/android/.idea/libraries/Gradle__com_nineoldandroids_library_2_4_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_parse_bolts_bolts_android_1_1_4_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_2_5_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_ws_2_5_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_6_0_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__commons_cli_commons_cli_1_2_jar.xml +0 -11
- package/android/.idea/libraries/Gradle__org_webkit_android_jsc_r174650_aar.xml +0 -10
- package/android/.idea/misc.xml +0 -23
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/runConfigurations.xml +0 -12
- package/android/.idea/workspace.xml +0 -322
- package/android/libs/AppICE_SDK_v2.4.18.jar +0 -0
- package/ios/.DS_Store +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib +0 -0
- package/ios/AppICESDK/include/iosAppiceSDK/appICEDB.h +0 -52
package/index.js
CHANGED
|
@@ -1,5 +1,109 @@
|
|
|
1
|
-
import { NativeModules } from 'react-native';
|
|
1
|
+
import { DeviceEventEmitter, NativeEventEmitter, NativeModules } from 'react-native';
|
|
2
|
+
import { Platform, Component } from 'react-native';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
+
const AppIceReactPlugin = NativeModules.AppIceReactPlugin;
|
|
5
|
+
var eventEmitter;
|
|
6
|
+
if(Platform.OS === 'ios')
|
|
7
|
+
{
|
|
8
|
+
eventEmitter = NativeModules.AppICEReactEvent ? new NativeEventEmitter(NativeModules.AppICEReactEvent) : DeviceEventEmitter;
|
|
9
|
+
}
|
|
10
|
+
else
|
|
11
|
+
{
|
|
12
|
+
eventEmitter = new NativeEventEmitter(NativeModules.AppIceReactPlugin);
|
|
13
|
+
}
|
|
14
|
+
var AppICEReact = {
|
|
15
|
+
AppICEPushNotificationClicked: AppIceReactPlugin.AppICEPushNotificationClicked,
|
|
16
|
+
name: AppIceReactPlugin.n,
|
|
17
|
+
email: AppIceReactPlugin.em,
|
|
18
|
+
phone: AppIceReactPlugin.ph,
|
|
19
|
+
age: AppIceReactPlugin.a,
|
|
20
|
+
gender: AppIceReactPlugin.g,
|
|
21
|
+
educationType: AppIceReactPlugin.ed,
|
|
22
|
+
employmentType: AppIceReactPlugin.et,
|
|
23
|
+
married: AppIceReactPlugin.m,
|
|
24
|
+
isEmployed: AppIceReactPlugin.is_emp,
|
|
25
|
+
validateIntegration: AppIceReactPlugin.validateIntegration,
|
|
4
26
|
|
|
5
|
-
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* add all of the registered listeners for given eventName.
|
|
30
|
+
*
|
|
31
|
+
* @param {string} eventName - name of the event whose registered listeners to remove
|
|
32
|
+
* @param {callback} handler - handler for events
|
|
33
|
+
*/
|
|
34
|
+
addListener: function (eventName, handler) {
|
|
35
|
+
if (eventEmitter) {
|
|
36
|
+
eventEmitter.addListener(eventName, handler);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Removes all of the registered listeners for given eventName.
|
|
42
|
+
*
|
|
43
|
+
* @param {string} eventName - name of the event whose registered listeners to remove
|
|
44
|
+
*/
|
|
45
|
+
removeListener: function (eventName) {
|
|
46
|
+
if (eventEmitter) {
|
|
47
|
+
eventEmitter.removeAllListeners(eventName);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Meta data of the apps that is needed for sdk setting
|
|
53
|
+
* @param {string} appID - meta key
|
|
54
|
+
* @param {string} appKey - meta key
|
|
55
|
+
* @param {string} apiKey - meta key
|
|
56
|
+
* @param {string} deviceID - unique value to idetify the data from panel
|
|
57
|
+
* @param {string} region - e.i. US/GCC/IND
|
|
58
|
+
* @param {string} baseUrl -
|
|
59
|
+
* @param {object} certs - arrays of certificate paths
|
|
60
|
+
* keys are strings and values can be string, number or boolean.
|
|
61
|
+
*/
|
|
62
|
+
startContext: function (appID, appKey, apiKey, deviceID, region, baseUrl, certs){
|
|
63
|
+
AppIceReactPlugin.startContext(appID, appKey, apiKey, deviceID, region, baseUrl, certs)
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Record an event with optional event properties
|
|
68
|
+
* @param {string} eventName - the name of the event
|
|
69
|
+
* @param {object} props - the key-value properties of the event.
|
|
70
|
+
* keys are strings and values can be string, number or boolean.
|
|
71
|
+
*/
|
|
72
|
+
tagEvent: function (eventName, props) {
|
|
73
|
+
AppIceReactPlugin.tagEvent(eventName, props);
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Record an click event
|
|
78
|
+
* @param {string} eventName - the name of the event
|
|
79
|
+
*/
|
|
80
|
+
pushNotificationClicked: function (payload) {
|
|
81
|
+
AppIceReactPlugin.pushNotificationClicked(payload);
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* to store custom varibles like fcm token..
|
|
86
|
+
* @param {string} eventName - the name of the event
|
|
87
|
+
* @param {string} props - the name of the event
|
|
88
|
+
*/
|
|
89
|
+
setCustomVariable: function (eventName, props) {
|
|
90
|
+
AppIceReactPlugin.setCustomVariable(eventName, props);
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Set key-value properties on a user profile
|
|
96
|
+
* @param {object} profile - key-value profile properties. keys are strings and values can be string, number or boolean.
|
|
97
|
+
*/
|
|
98
|
+
setUser: function (profile) {
|
|
99
|
+
console.log(profile);
|
|
100
|
+
AppIceReactPlugin.setUser(profile);
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
setUserId: function (values) {
|
|
104
|
+
AppIceReactPlugin.setUserId(values);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
module.exports = AppICEReact;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AppICEReactEvent.h
|
|
3
|
+
// AppIceReactPlugin
|
|
4
|
+
//
|
|
5
|
+
// Created by Garima Paliwal on 09/08/22.
|
|
6
|
+
// Copyright © 2022 Facebook. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import <React/RCTBridgeModule.h>
|
|
11
|
+
#import <React/RCTEventEmitter.h>
|
|
12
|
+
#import <UserNotifications/UserNotifications.h>
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
@interface AppICEReactEvent : RCTEventEmitter <RCTBridgeModule, UNUserNotificationCenterDelegate>
|
|
17
|
+
-(void)didReceiveNotificationResponse:(NSNotification *)event;
|
|
18
|
+
+ (id)allocWithZone:(NSZone *)zone;
|
|
19
|
+
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#import "AppICEReactEvent.h"
|
|
2
|
+
#import <React/RCTEventEmitter.h>
|
|
3
|
+
#import <UserNotifications/UserNotifications.h>
|
|
4
|
+
#import "AppIceReactPlugin.h"
|
|
5
|
+
@implementation AppICEReactEvent
|
|
6
|
+
|
|
7
|
+
RCT_EXPORT_MODULE();
|
|
8
|
+
|
|
9
|
+
+ (BOOL)requiresMainQueueSetup {
|
|
10
|
+
return NO;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
- (dispatch_queue_t)methodQueue {
|
|
14
|
+
return dispatch_get_main_queue();
|
|
15
|
+
}
|
|
16
|
+
+ (id)allocWithZone:(NSZone *)zone {
|
|
17
|
+
static AppICEReactEvent *sharedInstance = nil;
|
|
18
|
+
static dispatch_once_t onceToken;
|
|
19
|
+
dispatch_once(&onceToken, ^{
|
|
20
|
+
sharedInstance = [super allocWithZone:zone];
|
|
21
|
+
[sharedInstance startObserving];
|
|
22
|
+
});
|
|
23
|
+
return sharedInstance;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
- (instancetype)init
|
|
28
|
+
{
|
|
29
|
+
if ((self = [super init]))
|
|
30
|
+
{
|
|
31
|
+
[self startObserving];
|
|
32
|
+
}
|
|
33
|
+
return self;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- (NSArray<NSString *> *)supportedEvents
|
|
37
|
+
{
|
|
38
|
+
return @[kAppICEPushNotificationClicked];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
- (void)startObserving {
|
|
43
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
44
|
+
selector:@selector(didReceiveNotificationResponse:)
|
|
45
|
+
name:kAppICEPushNotificationClicked
|
|
46
|
+
object:nil];
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
- (void)stopObserving {
|
|
52
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
-(void)didReceiveNotificationResponse:(NSNotification *)event{
|
|
60
|
+
[self sendEventWithName:kAppICEPushNotificationClicked body:event.userInfo];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@end
|
|
65
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AppICEHelper.h
|
|
3
|
+
// appiceTestApp
|
|
4
|
+
//
|
|
5
|
+
// Created by garima paliwal on 29/09/20.
|
|
6
|
+
// Copyright © 2020 Semusi. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
@class appICEUserDetails;
|
|
14
|
+
|
|
15
|
+
@interface AppICEHelper : NSObject
|
|
16
|
+
|
|
17
|
+
+ (instancetype)sharedInstance;
|
|
18
|
+
//To start sdk
|
|
19
|
+
+(void)startContext;
|
|
20
|
+
|
|
21
|
+
//initialising keys
|
|
22
|
+
+(void) setupKeys:(NSString *)appKey withapiKey:(NSString *)apiKey withappId:(NSString *)appId otherSdkdeviceId:(NSString*)deviceId;
|
|
23
|
+
|
|
24
|
+
+(void) setupKeys:(NSString *)appKey withapiKey:(NSString *)apiKey withappId:(NSString *)appId otherSdkdeviceId:(NSString*)deviceId region:(NSString*)region baseUrl:(NSString *)baseUrl certficates:(NSArray *)certficates;
|
|
25
|
+
|
|
26
|
+
+(void) setupKeys:(NSString *)appKey withapiKey:(NSString *)apiKey withappId:(NSString *)appId;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
//to validate integration
|
|
30
|
+
+(BOOL)validateIntegration;
|
|
31
|
+
|
|
32
|
+
//to set custom events
|
|
33
|
+
+ (void)recordEvent:(NSString *)key;
|
|
34
|
+
|
|
35
|
+
+(void)recordEvent:(NSString *)key segmentation:(NSDictionary *)segmentation;
|
|
36
|
+
|
|
37
|
+
//to set custom variable:
|
|
38
|
+
+(void) setCustomVariable:(NSString*) key withStringValue:(NSString*)value;
|
|
39
|
+
|
|
40
|
+
+(void) setCustomVariable:(NSString*) key withBoolValue:(BOOL)value;
|
|
41
|
+
|
|
42
|
+
+(void) setCustomVariable:(NSString*)key withLongValue:(int64_t) value;
|
|
43
|
+
|
|
44
|
+
+(void) setCustomVariable:(NSString*) key withIntvalue:(int32_t) value;
|
|
45
|
+
|
|
46
|
+
//To check appice sdkversion
|
|
47
|
+
+(NSString*) getSdkVersion;
|
|
48
|
+
|
|
49
|
+
// to get the device id:
|
|
50
|
+
+(NSString *)getInternalId;
|
|
51
|
+
|
|
52
|
+
//to set unique userId
|
|
53
|
+
+(void)setUserId:(NSArray*) userIdArray;
|
|
54
|
+
|
|
55
|
+
// to set userDetails:
|
|
56
|
+
+(void) setUserDetail:(appICEUserDetails*) userdetail;
|
|
57
|
+
|
|
58
|
+
// to get userDetails:
|
|
59
|
+
+(appICEUserDetails*)getUserDetail;
|
|
60
|
+
|
|
61
|
+
// for camp-clicked
|
|
62
|
+
+ (void)pushNotificationClickedEvent:(NSString *)notificationData;
|
|
63
|
+
|
|
64
|
+
// for camp-received
|
|
65
|
+
+ (void)pushNotificationReceived:(id _Nonnull)notificationData;
|
|
66
|
+
|
|
67
|
+
//## to check if push payload is for appice:
|
|
68
|
+
+(BOOL)isAppICENotification:(NSString *)userInfo;
|
|
69
|
+
|
|
70
|
+
+(void) setTokenInPushNotification:(NSString*) appPushToken;
|
|
71
|
+
|
|
72
|
+
+(void) handleClickOnPush:(NSString *)data openDeepLink:(BOOL)openDeepLink;
|
|
73
|
+
|
|
74
|
+
+ (BOOL)isSilentPush:(NSString*) payload;
|
|
75
|
+
@end
|
|
76
|
+
|
|
77
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
20
20
|
@property (strong, nonatomic) NSString *messageTitle;
|
|
21
21
|
@property (strong, nonatomic) NSString *messageStatus;
|
|
22
22
|
@property (strong, nonatomic) NSString *messageLanguage;
|
|
23
|
+
@property (strong, nonatomic) NSString *messageCampid;
|
|
23
24
|
@property (strong, nonatomic) NSMutableDictionary *customData;
|
|
24
25
|
@property (nonatomic) double messageExpiryTime;
|
|
25
26
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AppICEJSInterface.h
|
|
3
|
+
// iosAppiceSDK
|
|
4
|
+
//
|
|
5
|
+
// Created by AIRBOOK on 02/03/22.
|
|
6
|
+
// Copyright © 2022 Semusi. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import <WebKit/WebKit.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
@interface AppICEJSInterface : NSObject <WKScriptMessageHandler>
|
|
15
|
+
@property (nonatomic, strong) WKUserContentController *userContentController;
|
|
16
|
+
- (instancetype)init;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -7,15 +7,17 @@
|
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
9
9
|
#import <UIKit/UIKit.h>
|
|
10
|
-
#import <CoreLocation/CoreLocation.h>
|
|
11
10
|
#import "AppICEInboxMessage.h"
|
|
12
11
|
|
|
13
12
|
@class appICEEventQueue;
|
|
14
13
|
@class appICEUserDetails;
|
|
15
14
|
@class appICEConnectionQueue;
|
|
16
15
|
|
|
17
|
-
@interface appICE : NSObject<
|
|
18
|
-
|
|
16
|
+
@interface appICE : NSObject<UIAlertViewDelegate,NSURLConnectionDelegate>{
|
|
17
|
+
NSMutableDictionary *inboxData;
|
|
18
|
+
}
|
|
19
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
20
|
+
@property (strong, nonatomic) NSMutableDictionary *inboxData;
|
|
19
21
|
+ (instancetype)sharedInstance;
|
|
20
22
|
+ (NSNumber*) getIncSequenceId;
|
|
21
23
|
|
|
@@ -30,19 +32,17 @@
|
|
|
30
32
|
// SET APPICE KEYS (APP ID , APP KEY , API KEY), IF YOU WANT TO USE ANY OTHER ANALYTICS SDK SIMULTANEOUSLY THEN PLEASE KEEP EMPTY IN DEVOCE ID
|
|
31
33
|
+(void) setupKeys:(NSString *)appKey withapiKey:(NSString *)apiKey withappId:(NSString *)appId otherSdkdeviceId:(NSString*)deviceId;
|
|
32
34
|
|
|
35
|
+
+(void) setupKeys:(NSString *)appKey withapiKey:(NSString *)apiKey withappId:(NSString *)appId otherSdkdeviceId:(NSString*)deviceId region:(NSString*)region baseUrl:(NSString *)baseUrl certficates:(NSArray *)certficates;
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
+(void) setupKeys:(NSString *)appKey withapiKey:(NSString *)apiKey withappId:(NSString *)appId;
|
|
35
38
|
|
|
36
|
-
+ (NSMutableDictionary *)NewDeviceandAppmetrics;
|
|
37
39
|
|
|
40
|
+
-(void)getAppAndUserData:(NSString*)profilestatus competingapisource:(NSString*)competingstatus campaignapisource:(NSString*)campaignstatus inboxsource:(NSString*)inboxstatus;
|
|
41
|
+
|
|
42
|
+
+ (NSMutableDictionary *)NewDeviceandAppmetrics;
|
|
38
43
|
|
|
39
|
-
-(void) campaignRecordEvent:(NSString *) KeyandCampaignID;
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
+(void) setTokenInPushNotification:(NSData*) AppPushToken;
|
|
43
|
-
+(void) receivePushNotification:(NSDictionary*) Pushdict;
|
|
44
|
-
-(void) openuUrlOnPushClick:(NSString*) localcampaid;
|
|
45
|
-
+(void) receiveLocalNotification:(UILocalNotification*) localNOTI;
|
|
45
|
+
-(void) campaignRecordEvent:(NSMutableArray *) KeyandCampaignID;
|
|
46
46
|
|
|
47
47
|
// EVENT TRACKING
|
|
48
48
|
- (void)recordEvent:(NSString *)key count:(int)count;
|
|
@@ -50,6 +50,10 @@
|
|
|
50
50
|
// EVENT TRACKING WITH SEGMENTATION
|
|
51
51
|
- (void)recordEvent:(NSString *)key segmentation:(NSDictionary *)segmentation count:(int)count;
|
|
52
52
|
|
|
53
|
+
typedef void (^AppICEInboxSuccessBlock)(BOOL success);
|
|
54
|
+
typedef void (^AppICEInboxCallback)(AppICEInboxMessage *AppICEInboxMessage);
|
|
55
|
+
//@property (nonatomic, copy) AppICEInboxSuccessBlock statement;
|
|
56
|
+
- (void)synchronizeInbox:(AppICEInboxSuccessBlock)CallBack timeoutinSec:(int)timeoutinSec;
|
|
53
57
|
// SET AND GET CHILD ID
|
|
54
58
|
-(void) setChildId:(NSString*)value;
|
|
55
59
|
|
|
@@ -58,14 +62,7 @@
|
|
|
58
62
|
// SET ALIAS FUNCTION
|
|
59
63
|
-(void) setAlias:(NSString*)value;
|
|
60
64
|
|
|
61
|
-
// PUSH CLICK METHOD
|
|
62
|
-
-(void) handleactionfirstforPUSH;
|
|
63
|
-
|
|
64
|
-
-(void) handleactionsecondforPUSH;
|
|
65
|
-
|
|
66
|
-
-(void) handleactionthirdforPUSH;
|
|
67
65
|
|
|
68
|
-
-(void) handleclickonpush:(NSDictionary*) push_dict;
|
|
69
66
|
|
|
70
67
|
// SET CUSTOM VARIABLE
|
|
71
68
|
-(void) setCustomVariable:(NSString*) key withStringValue:(NSString*)value;
|
|
@@ -94,31 +91,80 @@
|
|
|
94
91
|
-(void) setSessionTimeout:(int) Timeout;
|
|
95
92
|
|
|
96
93
|
// Set User Detail
|
|
94
|
+
-(void) setUserDetail:(appICEUserDetails*) userdetail;
|
|
97
95
|
|
|
98
|
-
|
|
96
|
+
//set multiple users id
|
|
97
|
+
-(void)setUserId:(NSArray*) userIdArray;
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
//get multiple users id
|
|
101
|
+
-(NSMutableArray*)getUserId;
|
|
99
102
|
|
|
100
|
-
//Get User Detail
|
|
101
103
|
|
|
102
|
-
|
|
104
|
+
//Get User Detail
|
|
105
|
+
-(appICEUserDetails*)getUserDetail;
|
|
103
106
|
-(NSString *)getInternalId;
|
|
104
107
|
|
|
105
108
|
//Get Inbox Message Count
|
|
106
109
|
-(int)getMessageCount :(int)status;
|
|
107
110
|
|
|
111
|
+
//Get Messages count with UserId & status
|
|
112
|
+
-(int)getMessageCount :(int)status userId:(NSArray *)userId;
|
|
113
|
+
|
|
108
114
|
//Get messages
|
|
109
115
|
-(NSMutableArray*)getInboxMessages :(int)status;
|
|
110
116
|
|
|
117
|
+
//Get Inbox messages with UserId & Status
|
|
118
|
+
-(NSMutableArray*)getInboxMessages :(int)status userId:(NSArray *)userId;
|
|
119
|
+
|
|
111
120
|
//Get message object belonging to the given message id only. Message id should be a String
|
|
112
121
|
-(AppICEInboxMessage*)getInboxMessageForId :(NSString*)messageId;
|
|
113
122
|
|
|
123
|
+
//Get the inbox message with a specified message identifier.
|
|
124
|
+
-(AppICEInboxMessage*)getInboxMessageForId :(NSString*)messageId userId:(NSArray *)userId;
|
|
125
|
+
|
|
126
|
+
//Get message object belonging to the given campid id only. campid id should be a String
|
|
127
|
+
-(void)getInboxMessageForCampaignId:(NSString*)campID callBack:(AppICEInboxCallback)callBack timeout:(int)timeout;
|
|
128
|
+
|
|
129
|
+
//Get the inbox message with a specified campid identifier and userid.
|
|
130
|
+
-(void)getInboxMessageForCampaignId:(NSString*)campID userId:(NSArray *)userId callBack:(AppICEInboxCallback)callBack timeout:(int)timeout;
|
|
131
|
+
|
|
132
|
+
|
|
114
133
|
//Mark Message as Read or deleted
|
|
115
134
|
-(BOOL)updateInboxMessage :(int)status :(NSString *)messageId;
|
|
135
|
+
-(BOOL)updateInboxMessage :(int)status messageId:(NSString *)messageId userid:(NSString *)userId;
|
|
116
136
|
|
|
137
|
+
//PUSH NOTIFICATIONS Methods
|
|
138
|
+
//check the server of the push Notifcations
|
|
139
|
+
-(BOOL)isAppICENotification:(NSDictionary *)userInfo;
|
|
117
140
|
|
|
141
|
+
// method for handling remote and local push Notifications: handles deep link and record event
|
|
142
|
+
-(void) handleClickOnPush:(id) userInfo OpenDeepLink:(BOOL)openDeepLink;
|
|
118
143
|
|
|
144
|
+
// Set device token
|
|
145
|
+
+(void) setTokenInPushNotification:(NSData*) appPushToken;
|
|
119
146
|
|
|
120
|
-
|
|
147
|
+
//get device Token and save it
|
|
148
|
+
+(void) deviceTokenForPushNotification:(NSString*) appPushTokenString;
|
|
149
|
+
|
|
150
|
+
//validating integration of sdk, returning bool value.
|
|
151
|
+
-(BOOL)validateIntegration;
|
|
152
|
+
|
|
153
|
+
//method for handling notfication clicked event
|
|
154
|
+
- (void)pushNotificationClickedEvent:(id _Nonnull)notificationData;
|
|
121
155
|
|
|
156
|
+
// method for handling notfication received event
|
|
157
|
+
- (void)pushNotificationReceived:(id _Nonnull)notificationData;
|
|
122
158
|
|
|
159
|
+
+ (void)runSyncMainQueue:(void (^)(void))block;
|
|
160
|
+
- (BOOL)isSilentPush:(NSDictionary*) payload;
|
|
123
161
|
|
|
124
162
|
|
|
163
|
+
-(NSMutableDictionary*)getInBoxData;
|
|
164
|
+
- (NSString*)expandedPushURL:(NSDictionary*) payload;
|
|
165
|
+
- (NSString*)expandedPushData:(NSDictionary*) payload;
|
|
166
|
+
-(void)renderNotification:(NSNotification*)data;
|
|
167
|
+
-(void)setInitialise:(NSString*)urlString;
|
|
168
|
+
@end
|
|
169
|
+
|
|
170
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -17,6 +17,12 @@ extern NSString* const kCLYUserEmail;
|
|
|
17
17
|
extern NSString* const kCLYUserOrganization;
|
|
18
18
|
extern NSString* const kCLYUserPhone;
|
|
19
19
|
extern NSString* const kCLYUserGender;
|
|
20
|
+
extern NSString* const kCLYUserBirthYear;
|
|
21
|
+
extern NSString* const kCLYUserIsUserEmployed;
|
|
22
|
+
extern NSString* const kCLYUserEmploymentType;
|
|
23
|
+
extern NSString* const kCLYUserEducationType;
|
|
24
|
+
extern NSString* const kCLYUserIsUserMarried;
|
|
25
|
+
extern NSString* const kCLYUserAge;
|
|
20
26
|
extern NSString* const kCLYUserPicture;
|
|
21
27
|
extern NSString* const kCLYUserPicturePath;
|
|
22
28
|
extern NSString* const kCLYUserBirthYear;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/ios/AppIceReactPlugin.h
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
|
+
#import <UserNotifications/UserNotifications.h>
|
|
3
|
+
static NSString *const kAppICEPushNotificationClicked = @"AppICEPushNotificationClicked";
|
|
4
|
+
static NSString *const kn = @"n";
|
|
5
|
+
static NSString *const kem = @"em";
|
|
6
|
+
static NSString *const kph = @"ph";
|
|
7
|
+
static NSString *const ka = @"a";
|
|
8
|
+
static NSString *const kg = @"g";
|
|
9
|
+
static NSString *const ked = @"ed";
|
|
10
|
+
static NSString *const ket = @"et";
|
|
11
|
+
static NSString *const km = @"m";
|
|
12
|
+
static NSString *const kis_emp = @"is_emp";
|
|
2
13
|
|
|
3
|
-
@interface AppIceReactPlugin : NSObject <RCTBridgeModule>
|
|
4
|
-
|
|
14
|
+
@interface AppIceReactPlugin : NSObject <RCTBridgeModule,UNUserNotificationCenterDelegate>
|
|
15
|
+
+(void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
|
|
16
|
+
+ (void)pushNotificationClicked:(NSDictionary *)userInfo;
|
|
17
|
+
+ (void)pushNotificationReceived:(NSDictionary *)userInfo;
|
|
5
18
|
@end
|
|
19
|
+
|
package/ios/AppIceReactPlugin.m
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
#import "AppIceReactPlugin.h"
|
|
2
|
+
#import "AppICEReactEvent.h"
|
|
2
3
|
#import "React/RCTLog.h"
|
|
3
4
|
#import "AppICESDK/include/iosAppiceSDK/appICE.h"
|
|
4
|
-
|
|
5
|
+
#import "AppICESDK/include/iosAppiceSDK/appICEUserDetails.h"
|
|
6
|
+
#import <UserNotifications/UserNotifications.h>
|
|
5
7
|
@implementation AppIceReactPlugin
|
|
6
8
|
|
|
7
9
|
RCT_EXPORT_MODULE()
|
|
10
|
+
+ (BOOL)requiresMainQueueSetup {
|
|
11
|
+
return NO;
|
|
12
|
+
}
|
|
8
13
|
|
|
14
|
+
- (NSDictionary *)constantsToExport {
|
|
15
|
+
return @{
|
|
16
|
+
kAppICEPushNotificationClicked : kAppICEPushNotificationClicked,
|
|
17
|
+
kn : kn,
|
|
18
|
+
kem : kem,
|
|
19
|
+
kph : kph,
|
|
20
|
+
ka : ka,
|
|
21
|
+
kg : kg,
|
|
22
|
+
ked : ked,
|
|
23
|
+
ket : ket,
|
|
24
|
+
km : km,
|
|
25
|
+
kis_emp : kis_emp
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
- (dispatch_queue_t)methodQueue {
|
|
29
|
+
return dispatch_get_main_queue();
|
|
30
|
+
}
|
|
9
31
|
RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnull NSNumber *)numberArgument callback:(RCTResponseSenderBlock)callback)
|
|
10
32
|
{
|
|
11
33
|
// TODO: Implement some actually useful functionality
|
|
@@ -15,13 +37,22 @@ RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnu
|
|
|
15
37
|
RCT_EXPORT_METHOD(startContext:(NSString *)appID
|
|
16
38
|
withAppKey:(NSString *)appKey
|
|
17
39
|
withApiKey:(NSString *)apiKey
|
|
18
|
-
withDeviceId:(NSString *)deviceId
|
|
40
|
+
withDeviceId:(NSString *)deviceId
|
|
41
|
+
region:(NSString *)region
|
|
42
|
+
baseUrl:(NSString *)baseUrl
|
|
43
|
+
certs : (NSArray *) certs)
|
|
19
44
|
{
|
|
20
|
-
[appICE setupKeys:appKey withapiKey:apiKey withappId:appID otherSdkdeviceId:deviceId];
|
|
45
|
+
[appICE setupKeys:appKey withapiKey:apiKey withappId:appID otherSdkdeviceId:deviceId region:region baseUrl:baseUrl certficates:certs];
|
|
46
|
+
|
|
21
47
|
|
|
22
48
|
[[appICE sharedInstance] startContext];
|
|
23
49
|
RCTLogInfo(@"App Ice SDK startContext");
|
|
24
50
|
}
|
|
51
|
+
+(void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
|
|
52
|
+
{
|
|
53
|
+
RCTLog(@"token is : %@",deviceToken);
|
|
54
|
+
[appICE setTokenInPushNotification:deviceToken];
|
|
55
|
+
}
|
|
25
56
|
|
|
26
57
|
RCT_EXPORT_METHOD(tagEvent:(NSString*)eventName withProps:(NSDictionary*)props)
|
|
27
58
|
{
|
|
@@ -40,20 +71,72 @@ RCT_EXPORT_METHOD(setCustomVariable:(NSString*)eventName withStringValue:(NSStri
|
|
|
40
71
|
|
|
41
72
|
}
|
|
42
73
|
|
|
43
|
-
RCT_EXPORT_METHOD(setUserId:(
|
|
74
|
+
RCT_EXPORT_METHOD(setUserId:(NSArray*)userIdArray)
|
|
44
75
|
{
|
|
45
|
-
[[appICE sharedInstance]
|
|
76
|
+
[[appICE sharedInstance] setUserId:userIdArray];
|
|
46
77
|
}
|
|
47
78
|
|
|
48
|
-
RCT_EXPORT_METHOD(
|
|
49
|
-
withPhoneNumber:(NSString*)phone
|
|
50
|
-
withEmail:(NSString*)email)
|
|
79
|
+
RCT_EXPORT_METHOD(pushNotificationClicked:(NSDictionary*)userInfo)
|
|
51
80
|
{
|
|
52
|
-
|
|
53
|
-
// app.name=name;
|
|
54
|
-
// app.phone = phone;
|
|
55
|
-
// app.email = email;
|
|
56
|
-
// [[appICE sharedInstance] setUser:app];
|
|
81
|
+
[[appICE sharedInstance] pushNotificationClickedEvent:userInfo];
|
|
57
82
|
}
|
|
83
|
+
RCT_EXPORT_METHOD(setUser:(NSDictionary*)userProfile)
|
|
84
|
+
{
|
|
85
|
+
NSArray *items = [NSArray arrayWithObjects:kCLYUserName,kCLYUserEmail,kCLYUserPhone,kCLYUserGender,kCLYUserBirthYear,kCLYUserAge,kCLYUserIsUserEmployed,kCLYUserEmploymentType,kCLYUserEducationType,kCLYUserIsUserMarried, nil];
|
|
86
|
+
appICEUserDetails *app=[appICEUserDetails new];
|
|
87
|
+
for(int i= 0; i< items.count ;i++)
|
|
88
|
+
{
|
|
89
|
+
|
|
90
|
+
if ([userProfile objectForKey:items[i]]) {
|
|
91
|
+
switch (i) {
|
|
92
|
+
case 0:
|
|
93
|
+
app.name = userProfile[items[i]];
|
|
94
|
+
break;
|
|
95
|
+
case 1:
|
|
96
|
+
app.email = userProfile[items[i]];
|
|
97
|
+
break;
|
|
98
|
+
case 2:
|
|
99
|
+
app.phone = userProfile[items[i]];
|
|
100
|
+
break;
|
|
101
|
+
case 3:
|
|
102
|
+
app.gender = userProfile[items[i]];
|
|
103
|
+
break;
|
|
104
|
+
case 4:
|
|
105
|
+
app.dob = userProfile[items[i]];
|
|
106
|
+
break;
|
|
107
|
+
case 5:
|
|
108
|
+
app.age = userProfile[items[i]];
|
|
109
|
+
break;
|
|
110
|
+
case 6:
|
|
111
|
+
app.is_user_employed = userProfile[items[i]];
|
|
112
|
+
break;
|
|
113
|
+
case 8:
|
|
114
|
+
app.employment_type = userProfile[items[i]];
|
|
115
|
+
break;
|
|
116
|
+
case 9:
|
|
117
|
+
app.education_type = userProfile[items[i]];
|
|
118
|
+
break;
|
|
119
|
+
case 10:
|
|
120
|
+
app.is_user_married = userProfile[items[i]];
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if(app != nil)
|
|
128
|
+
{
|
|
129
|
+
[[appICE sharedInstance] setUserDetail:app];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
}
|
|
58
133
|
|
|
134
|
+
+ (void)pushNotificationClicked:(NSDictionary *)userInfo {
|
|
135
|
+
NSDictionary *event = @{ kAppICEPushNotificationClicked : userInfo};
|
|
136
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:kAppICEPushNotificationClicked object:nil userInfo:event];
|
|
137
|
+
}
|
|
138
|
+
+ (void)pushNotificationReceived:(NSDictionary *)userInfo {
|
|
139
|
+
[[appICE sharedInstance]pushNotificationReceived:userInfo];
|
|
140
|
+
}
|
|
59
141
|
@end
|
|
142
|
+
|