cordova-plugin-appice 2.2.6 → 2.2.8
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/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
3
|
-
id="cordova-plugin-appice" version="2.2.
|
|
3
|
+
id="cordova-plugin-appice" version="2.2.8">
|
|
4
4
|
<name>AppICE</name>
|
|
5
5
|
<description>AppICE Plugin for Cordova/PhoneGap</description>
|
|
6
6
|
<license>Commercial</license>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
<podspec>
|
|
43
43
|
<pods>
|
|
44
|
-
<pod name="AppICE-IOS-SDK" spec="1.8.
|
|
44
|
+
<pod name="AppICE-IOS-SDK" spec="1.8.02" />
|
|
45
45
|
</pods>
|
|
46
46
|
</podspec>
|
|
47
47
|
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
<preference name="MEDIA3_UI_VERSION" default="1.0.2"/>
|
|
122
122
|
|
|
123
123
|
<!-- AppICE VERSION-->
|
|
124
|
-
<preference name="APPICE_VERSION" default="2.6.
|
|
124
|
+
<preference name="APPICE_VERSION" default="2.6.17"/>
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
<!-- USES PERMISSION -->
|
|
@@ -62,6 +62,7 @@ public class AppICEPlugin extends CordovaPlugin {
|
|
|
62
62
|
private static boolean inBackground = true;
|
|
63
63
|
private static CallbackContext notificationCallbackContext;
|
|
64
64
|
private static CallbackContext callbackContext;
|
|
65
|
+
private static CordovaWebView mwebView;
|
|
65
66
|
|
|
66
67
|
@Retention(RUNTIME)
|
|
67
68
|
@interface CordovaMethod {
|
|
@@ -114,7 +115,7 @@ public class AppICEPlugin extends CordovaPlugin {
|
|
|
114
115
|
@Override
|
|
115
116
|
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
|
116
117
|
super.initialize(cordova, webView);
|
|
117
|
-
|
|
118
|
+
mwebView = webView;
|
|
118
119
|
onNewIntent(cordova.getActivity().getIntent());
|
|
119
120
|
}
|
|
120
121
|
|
|
@@ -739,22 +740,25 @@ public class AppICEPlugin extends CordovaPlugin {
|
|
|
739
740
|
}
|
|
740
741
|
}
|
|
741
742
|
|
|
742
|
-
public
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
743
|
+
public void sendNotification(JSONObject bundle, Context context) {
|
|
744
|
+
try {
|
|
745
|
+
String pushPayload = bundle.getString("ai_content");
|
|
746
|
+
String eventName = "pushNotificationClicked";
|
|
747
|
+
String js = "cordova.fireDocumentEvent('" + eventName + "', { payload: " + pushPayload + " });";
|
|
748
|
+
|
|
749
|
+
if (mwebView != null && mwebView.getEngine() != null) {
|
|
750
|
+
mwebView.getView().post(new Runnable() {
|
|
751
|
+
@Override
|
|
752
|
+
public void run() {
|
|
753
|
+
mwebView.getEngine().evaluateJavascript(js, null);
|
|
752
754
|
}
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
}
|
|
755
|
+
});
|
|
756
|
+
} else {
|
|
757
|
+
Utility.loginfo("WebView or its engine is null");
|
|
758
|
+
}
|
|
759
|
+
} catch (Exception e) {
|
|
760
|
+
Utility.loginfo("Error sending notification to JS "+e);
|
|
761
|
+
}
|
|
758
762
|
}
|
|
759
763
|
|
|
760
764
|
// ==================================
|
|
@@ -1585,7 +1589,7 @@ public class AppICEPlugin extends CordovaPlugin {
|
|
|
1585
1589
|
public void run() {
|
|
1586
1590
|
ClickCallback clickCallback = new ClickCallback() {
|
|
1587
1591
|
@Override
|
|
1588
|
-
public void clickPayload(
|
|
1592
|
+
public void clickPayload(JSONObject obj) {
|
|
1589
1593
|
if (Utility.isValidObject(obj)) {
|
|
1590
1594
|
if (callbackContext != null) {
|
|
1591
1595
|
try {
|
|
@@ -1601,7 +1605,6 @@ public class AppICEPlugin extends CordovaPlugin {
|
|
|
1601
1605
|
CampaignCampsReceiver campaignCampsReceiver = new CampaignCampsReceiver(clickCallback);
|
|
1602
1606
|
}
|
|
1603
1607
|
});
|
|
1604
|
-
callbackContext.success();
|
|
1605
1608
|
} catch (Throwable e) {
|
|
1606
1609
|
callbackContext.error(e.getMessage());
|
|
1607
1610
|
}
|
|
@@ -46,8 +46,9 @@ public class CampaignCampsReceiver extends BroadcastReceiver {
|
|
|
46
46
|
|
|
47
47
|
if (inApp) {
|
|
48
48
|
if (cdata != null && cdata.length() > 0) {
|
|
49
|
+
JSONObject cdataObject = new JSONObject(cdata);
|
|
49
50
|
if (clickCallback != null) {
|
|
50
|
-
clickCallback.clickPayload(
|
|
51
|
+
clickCallback.clickPayload(cdataObject);
|
|
51
52
|
Utility.loginfo("CampaignRec : clickCallback "+cdata);
|
|
52
53
|
} else
|
|
53
54
|
Utility.loginfo("callback is null");
|
|
@@ -103,7 +104,8 @@ public class CampaignCampsReceiver extends BroadcastReceiver {
|
|
|
103
104
|
Log.e(TAG, "sendCallback: error ",e );
|
|
104
105
|
}
|
|
105
106
|
|
|
106
|
-
AppICEPlugin
|
|
107
|
+
AppICEPlugin plugin=new AppICEPlugin();
|
|
108
|
+
plugin.sendNotification(json, context);
|
|
107
109
|
} catch (Throwable e) {
|
|
108
110
|
Log.e(TAG, "sendCallback: error ",e );
|
|
109
111
|
}
|
package/src/ios/AppICEPlugin.m
CHANGED
|
@@ -1584,9 +1584,7 @@ static NSDictionary *pendingDeeplink = nil;
|
|
|
1584
1584
|
- (void)suspendInApp:(CDVInvokedUrlCommand *)command {
|
|
1585
1585
|
[self.commandDelegate runInBackground:^{
|
|
1586
1586
|
@try {
|
|
1587
|
-
|
|
1588
|
-
/**NOTE: As suspendInApp is queing the INAPP ,calling discardInApp in suspendInApp function which will do NOTHING (not queue) Done as Android**/
|
|
1589
|
-
[[appICE sharedInstance] discardInApp];
|
|
1587
|
+
[[appICE sharedInstance] suspendInApp];
|
|
1590
1588
|
CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
|
|
1591
1589
|
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
|
1592
1590
|
} @catch (NSException *e) {
|