react-native-share 12.2.1 → 12.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/ios/WhatsAppShare.m +21 -1
- package/package.json +15 -9
package/README.md
CHANGED
package/ios/WhatsAppShare.m
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
typedef NS_ENUM(NSInteger, MessageType) {
|
|
12
12
|
MessageTypeImage,
|
|
13
13
|
MessageTypeVideo,
|
|
14
|
-
MessageTypeText
|
|
14
|
+
MessageTypeText,
|
|
15
|
+
MessageTypeAudio
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
@implementation WhatsAppShare
|
|
@@ -44,6 +45,10 @@ resolve:(RCTPromiseResolveBlock)resolve {
|
|
|
44
45
|
case MessageTypeVideo:
|
|
45
46
|
[self tryToSendVideo: options resolve:resolve reject:reject];
|
|
46
47
|
break;
|
|
48
|
+
|
|
49
|
+
case MessageTypeAudio:
|
|
50
|
+
[self tryToSendAudio:options resolve:resolve reject:reject];
|
|
51
|
+
break;
|
|
47
52
|
|
|
48
53
|
default:
|
|
49
54
|
[self tryToSendText: options resolve:resolve reject:reject];
|
|
@@ -93,6 +98,16 @@ resolve:(RCTPromiseResolveBlock)resolve {
|
|
|
93
98
|
resolve(@[@true, @""]);
|
|
94
99
|
}
|
|
95
100
|
|
|
101
|
+
- (void)tryToSendAudio:(NSDictionary *)options
|
|
102
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
103
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
104
|
+
|
|
105
|
+
NSLog(@"Sending whatsapp audio");
|
|
106
|
+
[self shareMedia:options[@"url"] documentUTI:@"net.whatsapp.audio"];
|
|
107
|
+
NSLog(@"Done whatsapp audio");
|
|
108
|
+
resolve(@[ @true, @"" ]);
|
|
109
|
+
}
|
|
110
|
+
|
|
96
111
|
-(void)tryToSendText:(NSDictionary *)options
|
|
97
112
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
98
113
|
reject:(RCTPromiseRejectBlock)reject {
|
|
@@ -123,6 +138,11 @@ resolve:(RCTPromiseResolveBlock)resolve {
|
|
|
123
138
|
if([self isMediaType:url mediaExtensions:videoExtensions]){
|
|
124
139
|
return MessageTypeVideo;
|
|
125
140
|
}
|
|
141
|
+
|
|
142
|
+
NSArray *audioExtensions = @[@".mp3", @".aac", @".ogg", @".wav", @".m4a"];
|
|
143
|
+
if ([self isMediaType:url mediaExtensions:audioExtensions]) {
|
|
144
|
+
return MessageTypeAudio;
|
|
145
|
+
}
|
|
126
146
|
|
|
127
147
|
return MessageTypeText;
|
|
128
148
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-share",
|
|
3
3
|
"description": "Social share, sending simple data to other apps.",
|
|
4
|
-
"version": "12.2.
|
|
4
|
+
"version": "12.2.3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/react-native-
|
|
7
|
+
"url": "git+https://github.com/react-native-share/react-native-share.git"
|
|
8
8
|
},
|
|
9
9
|
"bugs": {
|
|
10
|
-
"url": "https://github.com/react-native-
|
|
10
|
+
"url": "https://github.com/react-native-share/react-native-share/issues"
|
|
11
11
|
},
|
|
12
12
|
"main": "lib/commonjs/index.js",
|
|
13
13
|
"react-native": "src/index.tsx",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"@expo/config-plugins": "^9.0.10",
|
|
36
36
|
"@react-native/eslint-config": "^0.74.0",
|
|
37
37
|
"@react-native/metro-config": "^0.73.2",
|
|
38
|
-
"@semantic-release/commit-analyzer": "^
|
|
38
|
+
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
39
39
|
"@semantic-release/git": "^10.0.1",
|
|
40
|
-
"@semantic-release/github": "^
|
|
41
|
-
"@semantic-release/npm": "^
|
|
42
|
-
"@semantic-release/release-notes-generator": "^
|
|
40
|
+
"@semantic-release/github": "^11.0.0",
|
|
41
|
+
"@semantic-release/npm": "^13.0.0",
|
|
42
|
+
"@semantic-release/release-notes-generator": "^14.0.0",
|
|
43
43
|
"@tsconfig/node-lts": "^22.0.0",
|
|
44
44
|
"@tsconfig/react-native": "^3.0.2",
|
|
45
45
|
"@types/react": "^18.2.37",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"react-native-builder-bob": "^0.23.1",
|
|
62
62
|
"react-native-windows": "^0.72.19",
|
|
63
63
|
"react-test-renderer": "^18.2.0",
|
|
64
|
-
"semantic-release": "^
|
|
64
|
+
"semantic-release": "^24.0.0",
|
|
65
65
|
"typescript": "^5.2.2",
|
|
66
66
|
"patch-package": "^8.0.0",
|
|
67
67
|
"postinstall-postinstall": "^2.1.0"
|
|
@@ -119,7 +119,13 @@
|
|
|
119
119
|
"plugins": [
|
|
120
120
|
"@semantic-release/commit-analyzer",
|
|
121
121
|
"@semantic-release/release-notes-generator",
|
|
122
|
-
|
|
122
|
+
[
|
|
123
|
+
"@semantic-release/npm",
|
|
124
|
+
{
|
|
125
|
+
"npmPublish": true,
|
|
126
|
+
"pkgRoot": "."
|
|
127
|
+
}
|
|
128
|
+
],
|
|
123
129
|
[
|
|
124
130
|
"@semantic-release/github",
|
|
125
131
|
{
|