Skip to content

Commit d78eaf5

Browse files
authored
chore: update readme
1 parent e11233a commit d78eaf5

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

packages/social-share/README.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import * as SocialShare from "@nativescript/social-share";
1818

1919
## API
2020

21-
### shareImage(ImageSource image, [optional] String subject)
21+
### shareImage(ImageSource image, \[optional\] String subject)
2222

2323
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:
2424

@@ -44,55 +44,52 @@ You can optionally provide a second argument to configure the subject on Android
4444
SocialShare.shareImage(image, "How would you like to share this image?");
4545
```
4646

47-
### shareText(String text, [optional] String subject)
47+
### shareText(String text, \[optional\] String subject)
4848

4949
The `shareText()` method expects a simple string:
5050

5151
```js
52-
SocialShare.shareText('I love NativeScript!');
52+
SocialShare.shareText('I love NativeScript!')
5353
```
5454

5555
Like `shareImage()`, you can optionally pass `shareText()` a second argument to configure the subject on Android:
5656

5757
```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?')
5959
```
6060

61-
### shareUrl(String url, String text, [optional] String subject)
61+
### shareUrl(String url, String text, \[optional\] String subject)
6262

6363
The `shareUrl()` method excepts a url and a string.
6464

6565
```js
66-
SocialShare.shareUrl('https://www.nativescript.org/', 'Home of NativeScript');
66+
SocialShare.shareUrl('https://www.nativescript.org/', 'Home of NativeScript')
6767
```
6868

6969
You can optionally pass `shareUrl()` a second argument to configure the subject on Android:
7070

7171
```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+
)
7377
```
7478

75-
### shareViaTwitter(text?: string, url?: string): Promise<void>;
79+
### shareViaTwitter(text?: string, url?: string): Promise\<void\>;
7680

7781
Share text or url via Twitter.
7882

79-
/\*\*
80-
81-
- Share via Facebook
82-
- @param {string} text - Text to share with URL.
83-
- @param {string} url - URL to share.
84-
\*/
85-
8683
```js
87-
SocialShare.shareViaTwitter('Home of NativeScript', 'https://www.nativescript.org/');
84+
SocialShare.shareViaTwitter('Home of NativeScript', 'https://www.nativescript.org/')
8885
```
8986

90-
### shareViaFacebook(text?: string, url?: string): Promise<void>;
87+
### shareViaFacebook(text?: string, url?: string): Promise\<void\>;
9188

9289
Share url via Facebook. Note that `text` will usually be suppressed due to Facebook security/abuse prevention, but the url will come through.
9390

9491
```js
95-
SocialShare.shareViaFacebook('Home of NativeScript', 'https://www.nativescript.org/');
92+
SocialShare.shareViaFacebook('Home of NativeScript', 'https://www.nativescript.org/')
9693
```
9794

9895
- **Android Only NOTE**:
@@ -133,9 +130,9 @@ dependencies {
133130
- Create a file `facebooklogin.xml` in `App_Resources/Android/src/main/res/values/`. Add this to the file (replace the id):
134131

135132
```xml
136-
<?xml version='1.0' encoding='utf-8'?>
133+
<?xml version='1.0' encoding='utf-8' ?>
137134
<resources>
138-
<string name="facebook_app_id">126035687816994</string>
135+
<string name="facebook_app_id">126035687816994</string>
139136
</resources>
140137
```
141138

0 commit comments

Comments
 (0)