react-native-share-menu icon indicating copy to clipboard operation
react-native-share-menu copied to clipboard

how to get "hello" value in main app after ShareMenuReactView.continueInApp({hello: 'from the other side'}) in IOS??

Open asadd-irfan opened this issue 3 years ago • 13 comments

my index.share.js file

import { AppRegistry } from 'react-native';
import Share from './App/Components/ShareInApp/ShareIos';

AppRegistry.registerComponent('ShareMenuModuleComponent', () => Share);

my Share.js file

const Share = () => {

  useEffect(() => {
    ShareMenuReactView.data().then(item => {
       ShareMenuReactView.continueInApp({
         hello: 'from the other side',
         data: item
       });
    });
  }, []);

  return null;
};

export default Share;

how to get these values (hello and data) in my main app??? please help

asadd-irfan avatar Sep 02 '22 17:09 asadd-irfan

@asadd-irfan Im also facing the same issue, please let me know when you find something

AsadAlihp avatar Sep 02 '22 18:09 AsadAlihp

@jdmunro @edbice @caiosba We are trying to get Data but getting undefined when app gets opened by continueInApp method

AsadAlihp avatar Sep 02 '22 18:09 AsadAlihp

@caiosba , @Gustash , @flogy ???

asadd-irfan avatar Sep 04 '22 11:09 asadd-irfan

@vstoyanoff

asadd-irfan avatar Sep 05 '22 11:09 asadd-irfan

same issue

feriarvis avatar Oct 26 '22 06:10 feriarvis

We found the issue, check you scheme URL, that's invalid

On Wed, Oct 26, 2022, 11:38 AM feriarvis @.***> wrote:

same issue

— Reply to this email directly, view it on GitHub https://github.com/meedan/react-native-share-menu/issues/207#issuecomment-1291569126, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXNPUNFANXRJVTTDV222WDWFDGWHANCNFSM6AAAAAAQDOG62A . You are receiving this because you commented.Message ID: @.***>

AsadAlihp avatar Oct 26 '22 06:10 AsadAlihp

how to get the extraData @AsadAlihp ?

feriarvis avatar Oct 26 '22 06:10 feriarvis

@feriarvis everything will work you just have to make sure you are providing correct URL scheme in your info.plist. We found the fix, our URL scheme was not matching thats why we were not getting extra data. once correct URL scheme provided everything started working.

AsadAlihp avatar Oct 26 '22 08:10 AsadAlihp

@AsadAlihp redirect to app work, but after open the app throwing error Invariant Violation: Native module cannot be null.

Simulator Screen Shot - iPhone 12 - 2022-10-27 at 17 06 11

feriarvis avatar Oct 27 '22 10:10 feriarvis

@feriarvis do pod install in ios directory

AsadAlihp avatar Oct 27 '22 10:10 AsadAlihp

@AsadAlihp still error

feriarvis avatar Oct 27 '22 10:10 feriarvis

@feriarvis did you this step: "Repeat this process for the Share Extension target, with the exact same group name." ? because i forgot this, and that caused the same error

kingajohanna avatar Nov 12 '22 20:11 kingajohanna

first make sure that you create group as documented in ( https://github.com/meedan/react-native-share-menu/blob/master/IOS_INSTRUCTIONS.md#create-app-group-and-url-scheme ) .

and make sure your HostAppURLScheme is match with your app CFBundleURLSchemes : form app you should add custom url in top of your prev urlScheme:

before your app info:

       ......
       <key>CFBundleURLSchemes</key>
       <array>
           // this is your app default URLSchemes
           <string>com.googleusercontent.xxxxxxxx</string>
       </array>
       .....

after your app info :

       .....
       <key>CFBundleURLSchemes</key>
       <array>
           // Add the following line
           <string>mycustomscheme</string>
           // this is your app default URLSchemes
           <string>com.googleusercontent.xxxxxxxx</string>
       </array>
       .....

and add new added url to your extension info ( note that we add :// to end of our url ) :

        .....
        <key>HostAppURLScheme</key>
	<string>mycustomscheme://</string>
        .....

after this steps your app will get data in ContinueInApp in array

sajjad-karimi avatar May 08 '23 11:05 sajjad-karimi