CanShareVia calls a success callback when it shouldn't - iOS 11.2

Description

When the Facebook application is not installed, the canShareVia method should cause an error callback that works fine with my iPhone5 with iOS 10.

When I test it on iPhone5 with iOS 11.2, it always calls a success callback in both cases when the Facebook application is installed and not installed.

applications

Cordova mobile app

Plugin: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin

Device info

  • iPhone 5s
  • iOS 11.2
  • Facebook app: not installed

Code example

window.plugins.socialsharing.canShareVia('com.apple.social.facebook', 'msg', null, null, null, 
function(success) {
   do some stuff....
}, function(error) {
   alert(error); 
});

Please let me know if any work has been found.


Update

Reason found:

plugin true iOS11. , .

+4
2

-plugin-appavailability.

( Appavailability, Facebook ).

appAvailability.check(
    'fb://',
    function() {  // Success callback
        window.plugins.socialsharing.shareViaFacebook(...)
    },
    function() {  // Error callback
        console.log('Facebook App is not available');
    }
);

, , , cordova-plugin-x-socialsharing.

+2

. . , .

+2

Source: https://habr.com/ru/post/1695753/


All Articles