so i wanted to create a cordova hybrid app using SalesforceMobileSDK alongside MarketingCloud plugin for push notification. I've added SalesforceMobileSDK cordova plugin and so far it runs perfectly. I also succesfully added MarketingCloud plugin into the project, but i still can't get it to work.
I've done all the setup required on Marketing Cloud side and implemented the code to my app and some function like MCCordovaPlugin.isPushEnabled is working seemingly fine. But everytime i called MCCordovaPlugin.enablePush, it doesn't return anything. Furthermore, everytime i run the app, it display a pop up that says it failed configureSDKwithAppID.
Here is the XCode log:
2018-03-06 17:06:45.971402+0700 Test[22207:348577] initiate MCCordovaPlugin
2018-03-06 17:06:45.971557+0700 Test[22207:348577] MCCordovaPlugin : [object Object]
2018/03/06 10:06:45.999 Test[22207:7c0b] DEBUG com.salesforce: webView:shouldStartLoadWithRequest:navigationType: Loading URL 'file:///Users/Wowow/Library/Developer/CoreSimulator/Devices/2C443269-FD84-44B4-BCD7-16289631BC62/data/Containers/Bundle/Application/3B830487-9AF7-4EE6-BB86-6118C4A8F96A/Test.app/www/index.html#/landing-page'
2018-03-06 17:06:46.000065+0700 Test[22207:348577] success isPushEnabled at appcomp
2018-03-06 17:06:46.002766+0700 Test[22207:348577] false
2018-03-06 17:06:46.002912+0700 Test[22207:348577] success getSystemToken
2018-03-06 17:06:46.005290+0700 Test[22207:348577] null
2018-03-06 17:06:47.859710+0700 Test[22207:348682] [BoringSSL] Function boringssl_session_errorlog: line 2871 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
2018-03-06 17:06:47.860121+0700 Test[22207:348682] [BoringSSL] Function boringssl_session_errorlog: line 2871 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
2018-03-06 17:07:45.976141+0700 Test[22207:348577] foundation version = 1450.000000
Here is the code snippet, the MCCordovaPlugin.isPushEnabled and MCCordovaPlugin.getSystemToken get success message while MCCordovaPlugin.enablePush doesn't appear on Log:
console.log("initiate MCCordovaPlugin");
console.log("MCCordovaPlugin : ",MCCordovaPlugin);
MCCordovaPlugin.enablePush(success => {
console.log("success enable push get");
console.log(success);
}, error =>{
console.log("error enable push get");
console.log(error);
});
MCCordovaPlugin.isPushEnabled((success)=>{
console.log("success isPushEnabled at appcomp");
console.log(success);
}, (error) => {
console.log("error isPushEnabled at appcomp");
console.log(error);
});
MCCordovaPlugin.getSystemToken((success)=>{
console.log("success getSystemToken");
console.log(success);
}, (error) => {
console.log("error getSystemToken");
console.log(error);
});
Here is the Screenshot of popup:
I am using Cordova 7.0.0, Cordova iOS 4.5.4, Java 1.8.0, SalesforceMobileSDk 5.3.0, and MC Cordova Plugin 1.0.2.
I also found another similar question, though it only has answers for Android so far: Marketing Cloud Cordova Plugin Push Notification Issue - iOS and Android
Any idea on how i can get this to work, guys? Thanks.
Regards.