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
Andy
committed
Jun 1, 2018
1 parent
b3cdb7a
commit 50968ac
Showing
5 changed files
with
198 additions
and
5 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
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
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
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,132 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Supported Deep Links based on https://www.instagram.com/developer/mobile-sharing/iphone-hooks/ | ||
*/ | ||
|
||
import { | ||
Platform | ||
} from 'react-native'; | ||
|
||
import { | ||
Launch, | ||
LaunchString | ||
} from './launcher'; | ||
|
||
import _ from 'lodash'; | ||
|
||
/** | ||
* @type {string} | ||
*/ | ||
const INSTAGRAM_APP = 'instagram://app'; | ||
|
||
/** | ||
* @type {string} | ||
*/ | ||
const INSTAGRAM_CAMERA = 'instagram://camera'; | ||
|
||
/** | ||
* @type {string} | ||
*/ | ||
const INSTAGRAM_MEDIA = 'instagram://media?id='; | ||
|
||
/** | ||
* @type {string} | ||
*/ | ||
const INSTAGRAM_USER = 'instagram://user?username='; | ||
|
||
/** | ||
* @type {string} | ||
*/ | ||
const INSTAGRAM_LOCATION = 'instagram://location?id='; | ||
|
||
/** | ||
* @type {string} | ||
*/ | ||
const INSTAGRAM_TAG = 'instagram://tag?name='; | ||
|
||
|
||
|
||
/** | ||
* Launches a Instagram User profile request | ||
* @param user | ||
* @returns {Promise} | ||
*/ | ||
const Instagram = (user) => | ||
{ | ||
return LaunchString('user', INSTAGRAM_USER + user); | ||
} | ||
|
||
|
||
/** | ||
* Launches a Instagram Media request | ||
* @param media | ||
* @returns {Promise} | ||
*/ | ||
const InstagramMedia = (media) => | ||
{ | ||
return LaunchString('media', INSTAGRAM_MEDIA + media); | ||
} | ||
|
||
|
||
/** | ||
* Launches a Instagram Location request | ||
* @param location | ||
* @returns {Promise} | ||
*/ | ||
const InstagramLocation = (location) => | ||
{ | ||
return LaunchString('location', INSTAGRAM_LOCATION + location); | ||
} | ||
|
||
|
||
/** | ||
* Launches a Instagram Tag request | ||
* @param tag | ||
* @returns {Promise} | ||
*/ | ||
const InstagramTag = (tag) => | ||
{ | ||
return LaunchString('tag', INSTAGRAM_TAG + tag); | ||
} | ||
|
||
|
||
/** | ||
* Launches the Instagram App | ||
* @returns {Promise} | ||
*/ | ||
const InstagramApp = () => | ||
{ | ||
return new Promise((resolve, reject) => { | ||
|
||
Launch(INSTAGRAM_CAMERA).then(() => resolve()).catch(error => reject(error)); | ||
}); | ||
} | ||
|
||
|
||
/** | ||
* Launches the Instagram Camera | ||
* @returns {Promise} | ||
*/ | ||
const InstagramCamera = () => | ||
{ | ||
return new Promise((resolve, reject) => { | ||
|
||
Launch(INSTAGRAM_CAMERA).then(() => resolve()).catch(error => reject(error)); | ||
}); | ||
} | ||
|
||
|
||
|
||
|
||
/** | ||
* @exports | ||
*/ | ||
export { | ||
Instagram, | ||
InstagramMedia, | ||
InstagramApp, | ||
InstagramCamera, | ||
InstagramTag, | ||
InstagramLocation | ||
} |
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
50968ac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've been trying to use this to open a instagram profile and have been having troubles with it. i posted it in the issues. i was wondering if you could maybe help me out with this. the user name for the profile is runaway.app and the id is 4546306012