-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening links in external apps #181
Conversation
…e profile page. In FormData page at editProfileFormDataRegular added a field call linkedin. In User page under initial state added linkedin field. In the iOS Info.plist added LSApplicationQueriesSchemes array and the whitelisted apps uri.
I have been able to test in expo code snip environment and works fine. I was not able to test in the app due to privilege in the database. Is there a test account? Also, ignore the "Reinstalled pods". I had to do it in my end to be able to build the app and should not be merge to the project. sorry for the inconvenience. |
…style to profile.js. Added the functions to OtherProfile.js to handle app linking there. In FormData.js jus did code clean up to the element added earlier in edit regular profile. ** in profile in form component in the values parameter I erase function that was formating the this.props.activeuser since it was creating a type missmatch in Form.js. the parameter values is expecting an object but was receiving an array. this cause the app to crash when onsubmit was called.**
I reopen the pull request after fixing some of the code and updated. Also found a problem that break the app when user click edit profile and then click submit. The problem is Profile under form when passing the value. In form the parameter values is expecting an object but is pass is an array. this is due to formatting the output to an array before passing it. |
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.
Some styling, formatting, and grammar issues.
- Try to keep your commit messages in active voice and present tense
- Keep commit messages less than 2 sentences long
- Make sure that you're paying attention to all the linter rules
@@ -161,11 +161,10 @@ const editProfileFormDataRegular = [ | |||
} | |||
}, | |||
{ | |||
placeholder: "LinkedIn Profile", | |||
placeholder: "LinkedIn Profile (after the in/)", |
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.
There should be another way of specifying this, as a non-technical user might not know what "after the in/" means
onPress = { () => { | ||
Alert.alert("Coming Soon"); | ||
// Actions.PostShow({ title: 'Linkedin', uri: 'https://www.linkedin.com/'}) | ||
this.openApp(linkedin, firstName); | ||
} }> |
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.
Can you move this onPress
into one line?
onPress = { () => { | ||
Alert.alert("Coming Soon"); | ||
// Actions.PostShow({ title: 'Github', uri: 'https://www.github.com/'}) | ||
this.openEmail(email, firstName); | ||
} } > |
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.
One line as well
|
||
async openApp(profile, name) { | ||
if (!profile) { | ||
Alert.alert(`${ name } has not added his LinkedIn profile yet.`); |
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.
Change to "...has not added their LinkedIn profile yet"
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.
Remove spaces around curly braces when using interpolation
let url = `linkedin://in/${ profile }`; | ||
|
||
console.log(`URL: ${ profile }`); | ||
// then have to check if the link can be handle |
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.
Remove unnecessary comment
@@ -174,6 +178,42 @@ class OtherProfile extends Component { | |||
</View> | |||
); | |||
} | |||
|
|||
async openApp(profile, name) { |
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.
Also specify app being opened
Alert.alert(`${ name } has not added his LinkedIn profile yet.`); | ||
} | ||
else { | ||
let url = `linkedin://in/${ profile }`; |
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.
Remove spaces around curly braces
if (canOpenLink) | ||
await Linking.openURL(url); | ||
else | ||
await Linking.openURL(`https://linkedin.com/in/${ profile }`); |
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.
No spaces around curly braces
|
||
async openEmail(to, name) { | ||
if (!to) { | ||
Alert.alert(`No email for ${ name } has been found.`); |
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.
Consider using the type: "error"
for alert. Also, remove spacing around curly braces for interpolation
Alert.alert(`No email for ${ name } has been found.`); | ||
} | ||
else { | ||
let url = `mailto:${ to }`; |
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.
Remove spacing around curly brace
Submitting another PR soon |
Fixes #136
Description
Added the functionality to open the linkedin app and mail when button clicked in the profile page. In profile page code to handle app linking for social media buttons added added using uri scheme and deep linking.
Types of changes
Checklist: