1

The Salesforce Mobile SDK has a cordova plugin. The Capacitor platform supports most but not all Cordova plugins (see known incompatability list). Does anyone know if the Salesforce mobile sdk cordova app works with Capacitor?

1

Capacitor is not a platform we officially support, but I do know that customers are using it and we have not heard about any large blocking issues. Our upkeep of Cordova is minimal at this point but we do not have any plans to adopt Capacitor at this time.

1
  • Ok, thanks. So you are saying customers are using the Salesforce MobileSDK Cordova plugin with Cordova and you've not heard of blocking issues? Or, you are saying that customers are using the Salesforce MobileSDK Cordova plugin with Capacitor and you've not heard of blocking issues? Also, since the Cordova upkeep is minimal, is the longer-term focus of the Salesforce Mobile SDK team React Native then?
    – Rozgonyi
    May 22 '20 at 18:44
1

UPDATE: after forking the plugin and making changes I have everything built and compiling. The app is registering in MC yet no client info is received nor do push notifications arrive in ios or in android. So my answer still stands: No it is not compatible out of the box.

I have been at it for over 2 days straight and I can not get my capacitor android app to compile with the MC-Cordova-Plugin. I have had to battle a lot of issues to get to a point where nothing seems to fix the latest error:

Parsing json file: xxxxx/android/capacitor-cordova-android-plugins/google-services.json

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':capacitor-cordova-android-plugins:processDebugGoogleServices'.
> No matching client found for package name ''

While the package name in google-services.json is certainly not an empty string.

So unless you hear otherwise on here I would assume it is not compatible. At the very least not out of the box

2
  • Did you ever make further progress with this? Is your forked version of the plugin public? Looking to start the same process so anything you could share would be awesome.
    – Phil B
    Aug 2 at 17:26
  • Yes I did get it to work in the end. My fork is at github.com/pzontrop/MC-Cordova-Plugin . It has been months so I don't remember exactly all the steps I had to take to make it work in the end but feel free to create an issue on the github fork if you need extra help. I will try to answer asap.
    – pascalzon
    Aug 4 at 8:10
0

We tried to use the SDK using the Capacitor, but it did not work properly. The notification is not received by the SDK, apparently the Capacitor receives it.

As the capacitor has a native push notification mechanism at its core, I suppose that the solution must pass through the receipt of the notification by the capacitor, which should call the MC SDK.

Thus, we are unable to use the features provided by the SDK. Probably, the best solution would be a rewritten plugin for Capacitor.

I suggested creating a new Capacitor plugin on the "Capacitor Community" forum on Github. If you want to vote on this suggestion, the link is this:

https://github.com/capacitor-community/proposals/issues/73

0

Using Capacitor 3.0.0-beta, it's work well with Android and I received the push notification with success.

But at iOS it's not working yet and I'm testing and debugging to understand what the problem is.

Has anyone successfully managed notifications with capacitor 3.0 on iOS?

1
  • On iOS, apparently, the opt-in is failing and the device does not register correctly. Feb 11 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.