2015-11-28 19 views
0

我已經找到了several of reverse examples:從應用程序做出反應發送到使用意圖另一個。註冊我的陣營原生應用的ShareAction可能性Android中

我發現一個傢伙explaining how to do this with IOS的博客文章。

但不是在Android上。 :(

我明白了什麼是from there我需要在AndroidManifest.xml中`」文件中添加了一句:?

<activity android:name=".ShareLink"> 
     <intent-filter> 
      <action android:name="android.intent.action.SEND" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
      <data android:mimeType="text/plain" /> 
     </intent-filter> 
    </activity> 

我說得對,這是APP_ROOT/node_modules/react-native/ReactAndroid/src/main/AndroidManifest.xml文件

它應該看這樣的呢?

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.facebook.react"> 
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> 
    <application /> 
    <activity android:name=".ShareLink"> 
     <intent-filter> 
      <action android:name="android.intent.action.SEND" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
      <data android:mimeType="text/plain" /> 
     </intent-filter> 
    </activity> 
</manifest> 

如何創建在帳篷?

一旦我的應用程序在列表中(wohoo),如何獲取React應用程序中的數據?

任何幫助將不勝感激。我是一名網站開發人員,喜歡React,但對Android來說完全是n00b。

回答

2

爲了讓我的應用程序在共享列表,它不是那麼很難在最後:

<APP_ROOT>/android/app/src/main/AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.appname"> 

    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 

    <application 
     android:allowBackup="true" 
     android:label="@string/app_name" 
     android:icon="@mipmap/ic_launcher" 
     android:theme="@style/AppTheme"> 
     <activity 
     android:name=".MainActivity" 
     android:label="@string/app_name"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="android.intent.action.SEND" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
      <data android:mimeType="text/plain" /> 
      </intent-filter> 
     </activity> 
     <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> 
    </application> 

</manifest> 

但是,一旦它在列表中,以使其可訪問React App,那很複雜。我詳細介紹了下一個回答下列問題的步驟:https://stackoverflow.com/a/33969430/1620081

相關問題