2017-10-13 5 views
0

내 반응 - 네이티브 응용 프로그램과 공유하기 위해 안드로이드 장치에 응용 프로그램을 만들려고합니다. 그러나 다른 응용 프로그램의 콘텐츠를 내 응용 프로그램과 공유 할 수있는 방법이 있는지 궁금 해서요.React-Native에 공유

명확한 설명 : enter image description here

나는 당신이 다른 앱이 활동을 시작 할 수 있도록 허용 할 필요 목록

+0

이 질문을 참조 할 수 있습니다. https://stackoverflow.com/questions/11095122/how-to-make-my-android-app-appear-in-the-share-list-of-another- 특정 앱 –

답변

0

에 내 응용 프로그램을 추가하려합니다.

<intent-filter android:label="Share here!"> 
       <action android:name="android.intent.action.SEND" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
       <data android:mimeType="text/*" /> 
</intent-filter> 

당신이 알다시피 reference here.,이 마법은 공유 목록에 앱이 표시됩니다.

부담을 줄이려면 구성 요소에 다음 스 니펫을 배치하십시오. 모든 구성 요소.

componentDidMount() { 
     Linking.getInitialURL().then((url) => { 
      console.log('Initial url is: ' + url); 
     }).catch(err => console.error('An error occurred', err)); 
    } 

이 매력은 Linking입니다. 발견 된 문서 here