-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 968be61
Showing
21 changed files
with
2,677 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"extends": ["airbnb", "prettier", "prettier/react"], | ||
"parser": "babel-eslint", | ||
"plugins": ["react", "jsx-a11y", "import", "prettier"], | ||
"rules": { | ||
"import/no-extraneous-dependencies": 0, | ||
"func-names": 0, | ||
"import/extensions": 0, | ||
"import/no-named-as-default": 0, | ||
"import/no-named-as-default-member": 0, | ||
"import/no-unresolved": 1, | ||
"jsx-a11y/no-static-element-interactions": 0, | ||
"no-extra-boolean-cast": 0, | ||
"no-plusplus": 0, | ||
"no-sequences": 0, | ||
"no-script-url": 0, | ||
"no-unused-vars": 1, | ||
"react/no-did-update-set-state": 0, | ||
"spaced-comment": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pbxproj -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
|
||
# Xcode | ||
# | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
project.xcworkspace | ||
|
||
|
||
# Android/IntelliJ | ||
# | ||
build/ | ||
.idea | ||
.gradle | ||
local.properties | ||
*.iml | ||
|
||
# BUCK | ||
buck-out/ | ||
\.buckd/ | ||
*.keystore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"insertPragma": false, | ||
"jsxBracketSameLine": false, | ||
"parser": "babylon", | ||
"printWidth": 80, | ||
"proseWrap": "always", | ||
"requirePragma": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "es5", | ||
"useTabs": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# react-native-story-share | ||
|
||
Currently only supports sharing of base64 images | ||
|
||
## Getting started | ||
|
||
`$ npm install react-native-story-share --save` | ||
|
||
or | ||
|
||
`$ yarn add react-native-story-share` | ||
|
||
## Installation | ||
1. Either choose `Mostly automatic installation` or `Manual installation` | ||
2. Follow the `Integration` guide | ||
|
||
### Mostly automatic installation | ||
|
||
`$ react-native link react-native-story-share` | ||
|
||
### Manual installation | ||
|
||
#### iOS | ||
|
||
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` | ||
2. Go to `node_modules` ➜ `react-native-story-share` and add `RNStoryShare.xcodeproj` | ||
3. In XCode, in the project navigator, select your project. Add `libRNStoryShare.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` | ||
4. Run your project (`Cmd+R`) | ||
|
||
#### Android | ||
|
||
1. Open up `android/app/src/main/java/[...]/MainActivity.java` | ||
|
||
- Add `import com.jobeso.RNStorySharePackage;` to the imports at the top of the file | ||
- Add `new RNStorySharePackage()` to the list returned by the `getPackages()` method | ||
|
||
2. Append the following lines to `android/settings.gradle`: | ||
``` | ||
include ':react-native-story-share' | ||
project(':react-native-story-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-story-share/android') | ||
``` | ||
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: | ||
``` | ||
compile project(':react-native-story-share') | ||
``` | ||
|
||
## Integration | ||
|
||
### iOS | ||
|
||
#### Swift | ||
|
||
1. Under `Build Settings` section `Build Options` set `Always Embed Swift Started Libraries` to `true` | ||
2. Make sure you have the following under `library search paths` | ||
|
||
``` | ||
$(inherited) | ||
$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) | ||
``` | ||
|
||
#### Info.plist | ||
|
||
+ add `instagram-stories` and `snapchat` to the `LSApplicationQueriesSchemes` key in your app's Info.plist. | ||
|
||
``` | ||
... | ||
<key>LSApplicationQueriesSchemes</key> | ||
<array> | ||
... | ||
<string>instagram-stories</string> | ||
<string>snapchat</string> | ||
</array> | ||
... | ||
``` | ||
|
||
## Usage | ||
|
||
```javascript | ||
import RNStoryShare from "react-native-story-share"; | ||
|
||
RNStoryShare.isInstagramAvailable() | ||
.then(isAvailable => { | ||
// your code | ||
}) | ||
.catch(e => console.log(e)); | ||
|
||
RNStoryShare.share({ | ||
type: RNStoryShare.Types.BASE64, | ||
attributionLink: 'https://myproject.com', | ||
backgroundAsset: '', | ||
stickerAsset: '', // currently iOS only | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.3.1' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.1" | ||
|
||
defaultConfig { | ||
minSdkVersion 16 | ||
targetSdkVersion 22 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile 'com.facebook.react:react-native:+' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.jobeso"> | ||
|
||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
|
||
<application> | ||
|
||
<provider | ||
android:name="com.jobeso.RNStoryShareFileProvider" | ||
android:authorities="${applicationId}.provider" | ||
android:exported="false" | ||
android:grantUriPermissions="true"> | ||
<meta-data | ||
android:name="android.support.FILE_PROVIDER_PATHS" | ||
android:resource="@xml/filepaths" /> | ||
</provider> | ||
|
||
</application> | ||
|
||
</manifest> | ||
|
6 changes: 6 additions & 0 deletions
6
android/src/main/java/com/jobeso/RNStoryShareFileProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.jobeso; | ||
|
||
import android.support.v4.content.FileProvider; | ||
|
||
public class RNStoryShareFileProvider extends FileProvider { | ||
} |
Oops, something went wrong.