2015-11-28 20 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

相关问题