Skip to content

Instantly share code, notes, and snippets.

@ThrowJojo
Created April 23, 2018 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThrowJojo/a9d05c52240e97dbb063ff4edc9fd79a to your computer and use it in GitHub Desktop.
Save ThrowJojo/a9d05c52240e97dbb063ff4edc9fd79a to your computer and use it in GitHub Desktop.
Sharing on LINE.
- (void) shareOnLine: (NSString*) text {
NSString *encodedText = [text stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]];
NSString *urlString = [NSString stringWithFormat:@"line://msg/text/%@", encodedText];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:^(BOOL success) {
// Do something on completion
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment