proyecto26 / react-native-inappbrowser

📱InAppBrowser for React Native (Android & iOS) 🤘
https://www.npmjs.com/package/react-native-inappbrowser-reborn
MIT License
1.31k stars 223 forks source link

[Android] fixed share icon display issue on android #462

Open hrishiakhade opened 1 month ago

hrishiakhade commented 1 month ago

PR Checklist

What is the current behavior?

enableDefaultShare: false is not working on android

What is the new behavior?

enableDefaultShare: false is now working on android

Fixes/Implements/Closes #[Issue Number].

Replaced the native library code in RNInAppBrowser.java

from

    if (options.hasKey(KEY_DEFAULT_SHARE_MENU_ITEM) && 
        options.getBoolean(KEY_DEFAULT_SHARE_MENU_ITEM)) {
      builder.addDefaultShareMenuItem();
    }

to if(options.hasKey(KEY_DEFAULT_SHARE_MENU_ITEM)){ if(options.getBoolean(KEY_DEFAULT_SHARE_MENU_ITEM)){ builder.setShareState(CustomTabsIntent.SHARE_STATE_ON); }else{ builder.setShareState(CustomTabsIntent.SHARE_STATE_OFF); } }else{ builder.setShareState(CustomTabsIntent.SHARE_STATE_OFF); }