@@ -18,7 +18,7 @@ import * as SocialShare from "@nativescript/social-share";
18
18
19
19
## API
20
20
21
- ### shareImage(ImageSource image, [ optional] String subject)
21
+ ### shareImage(ImageSource image, \ [ optional\ ] String subject)
22
22
23
23
The ` shareImage() ` method expects an [ ` ImageSource ` ] ( http://docs.nativescript.org/ApiReference/image-source/ImageSource.html ) object. The code below loads an image from the app and invokes the share widget with it:
24
24
@@ -44,55 +44,52 @@ You can optionally provide a second argument to configure the subject on Android
44
44
SocialShare .shareImage (image, " How would you like to share this image?" );
45
45
```
46
46
47
- ### shareText(String text, [ optional] String subject)
47
+ ### shareText(String text, \ [ optional\ ] String subject)
48
48
49
49
The ` shareText() ` method expects a simple string:
50
50
51
51
``` js
52
- SocialShare .shareText (' I love NativeScript!' );
52
+ SocialShare .shareText (' I love NativeScript!' )
53
53
```
54
54
55
55
Like ` shareImage() ` , you can optionally pass ` shareText() ` a second argument to configure the subject on Android:
56
56
57
57
``` js
58
- SocialShare .shareText (' I love NativeScript!' , ' How would you like to share this text?' );
58
+ SocialShare .shareText (' I love NativeScript!' , ' How would you like to share this text?' )
59
59
```
60
60
61
- ### shareUrl(String url, String text, [ optional] String subject)
61
+ ### shareUrl(String url, String text, \ [ optional\ ] String subject)
62
62
63
63
The ` shareUrl() ` method excepts a url and a string.
64
64
65
65
``` js
66
- SocialShare .shareUrl (' https://www.nativescript.org/' , ' Home of NativeScript' );
66
+ SocialShare .shareUrl (' https://www.nativescript.org/' , ' Home of NativeScript' )
67
67
```
68
68
69
69
You can optionally pass ` shareUrl() ` a second argument to configure the subject on Android:
70
70
71
71
``` js
72
- SocialShare .shareUrl (' https://www.nativescript.org/' , ' Home of NativeScript' , ' How would you like to share this url?' );
72
+ SocialShare .shareUrl (
73
+ ' https://www.nativescript.org/' ,
74
+ ' Home of NativeScript' ,
75
+ ' How would you like to share this url?'
76
+ )
73
77
```
74
78
75
- ### shareViaTwitter(text?: string, url?: string): Promise<void >;
79
+ ### shareViaTwitter(text?: string, url?: string): Promise\ < void\ > ;
76
80
77
81
Share text or url via Twitter.
78
82
79
- /\*\*
80
-
81
- - Share via Facebook
82
- - @param {string} text - Text to share with URL.
83
- - @param {string} url - URL to share.
84
- \* /
85
-
86
83
``` js
87
- SocialShare .shareViaTwitter (' Home of NativeScript' , ' https://www.nativescript.org/' );
84
+ SocialShare .shareViaTwitter (' Home of NativeScript' , ' https://www.nativescript.org/' )
88
85
```
89
86
90
- ### shareViaFacebook(text?: string, url?: string): Promise<void >;
87
+ ### shareViaFacebook(text?: string, url?: string): Promise\ < void\ > ;
91
88
92
89
Share url via Facebook. Note that ` text ` will usually be suppressed due to Facebook security/abuse prevention, but the url will come through.
93
90
94
91
``` js
95
- SocialShare .shareViaFacebook (' Home of NativeScript' , ' https://www.nativescript.org/' );
92
+ SocialShare .shareViaFacebook (' Home of NativeScript' , ' https://www.nativescript.org/' )
96
93
```
97
94
98
95
- ** Android Only NOTE** :
@@ -133,9 +130,9 @@ dependencies {
133
130
- Create a file ` facebooklogin.xml ` in ` App_Resources/Android/src/main/res/values/ ` . Add this to the file (replace the id):
134
131
135
132
``` xml
136
- <?xml version =' 1.0' encoding =' utf-8' ?>
133
+ <?xml version =' 1.0' encoding =' utf-8' ?>
137
134
<resources >
138
- <string name =" facebook_app_id" >126035687816994</string >
135
+ <string name =" facebook_app_id" >126035687816994</string >
139
136
</resources >
140
137
```
141
138
0 commit comments