react-native-beidou 1.1.2 → 1.1.4

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/index.ts CHANGED
@@ -31,17 +31,9 @@ export type BluetoothStatus = 'NotSupported' | 'NO' | 'OK';
31
31
 
32
32
  // ================== 北斗AIDL服务相关类型定义 ==================
33
33
  export interface BDStatusResponse {
34
- slotId?: number;
35
34
  code: number;
36
35
  statusMsg: string;
37
36
  msgQuotaRemain: number;
38
- userOpenStatus: number;
39
- }
40
-
41
- export interface BDAuthResult {
42
- slotId: number;
43
- code: number;
44
- statusMsg: string | null;
45
37
  }
46
38
 
47
39
  export interface BDMsgEncryptResponse {
@@ -49,7 +41,6 @@ export interface BDMsgEncryptResponse {
49
41
  statusMsg: string;
50
42
  data: number[]; // byte array as number array
51
43
  sendMobile: string;
52
- len: number;
53
44
  }
54
45
 
55
46
  export interface BDMsgDecryptResponse {
@@ -60,11 +51,9 @@ export interface BDMsgDecryptResponse {
60
51
  }
61
52
 
62
53
  export interface BDMsgEphemerisFileDLResponse {
63
- slotId: number;
64
54
  code: number;
65
55
  statusMsg: string;
66
56
  ephemerisZipFile: number[]; // byte array as number array
67
- ephemerisZipFileName: string | null;
68
57
  version: string;
69
58
  }
70
59
 
@@ -190,21 +179,21 @@ export const unbindBeiDouService = async (): Promise<boolean> => {
190
179
  /**
191
180
  * 北斗服务鉴权
192
181
  */
193
- export const authenticateBeiDou = async (slotId: number = 0): Promise<BDAuthResult> => {
182
+ export const authenticateBeiDou = async (slotId: number): Promise<boolean> => {
194
183
  return await BeiDouBluetoothModule.BDAuthenticate(slotId);
195
184
  };
196
185
 
197
186
  /**
198
187
  * 查询北斗用户开通状态及额度
199
188
  */
200
- export const getBeiDouStatus = async (slotId: number = 0): Promise<BDStatusResponse> => {
189
+ export const getBeiDouStatus = async (slotId: number): Promise<BDStatusResponse> => {
201
190
  return await BeiDouBluetoothModule.getBDMsgStatus(slotId);
202
191
  };
203
192
 
204
193
  /**
205
194
  * 检查北斗密钥状态
206
195
  */
207
- export const checkBeiDouKey = async (slotId: number = 0): Promise<number> => {
196
+ export const checkBeiDouKey = async (slotId: number): Promise<number> => {
208
197
  return await BeiDouBluetoothModule.checkValidatedKey(slotId);
209
198
  };
210
199
 
@@ -212,137 +201,54 @@ export const checkBeiDouKey = async (slotId: number = 0): Promise<number> => {
212
201
  * 通用北斗报文编码加密
213
202
  */
214
203
  export const encryptCommonBeiDouMessage = async (
215
- slotId: number = 0,
216
- speedType: string = '0',
204
+ slotId: number,
217
205
  receiveList: string[],
218
206
  inputMsg: string
219
- ): Promise<BDMsgEncryptResponse[]> => BeiDouBluetoothModule.commonBDMsgEncrypt(slotId, speedType, receiveList, inputMsg);
207
+ ): Promise<BDMsgEncryptResponse> => {
208
+ return await BeiDouBluetoothModule.commonBDMsgEncrypt(slotId, receiveList, inputMsg);
209
+ };
220
210
 
221
211
  /**
222
212
  * 位置信息北斗报文编码加密
223
213
  */
224
214
  export const encryptPositionBeiDouMessage = async (
225
- slotId: number = 0,
226
- speedType: string = '0',
227
- receiveList: string[],
228
- inputMsg: string,
229
- longitude: number,
230
- latitude: number
231
- ): Promise<BDMsgEncryptResponse[]> =>
232
- BeiDouBluetoothModule.positionBDMsgEncrypt(slotId, speedType, receiveList, inputMsg, longitude, latitude);
233
-
234
- export const encryptCommonEmergencyBeiDouMessage = async (
235
- slotId: number = 0,
236
- speedType: string = '0',
237
- receiveList: string[],
238
- inputMsg: string
239
- ): Promise<BDMsgEncryptResponse[]> =>
240
- BeiDouBluetoothModule.commonEmergencyBDMsgEncrypt(slotId, speedType, receiveList, inputMsg);
241
-
242
- export const encryptPositionEmergencyBeiDouMessage = async (
243
- slotId: number = 0,
244
- speedType: string = '0',
215
+ slotId: number,
245
216
  receiveList: string[],
246
217
  inputMsg: string,
247
218
  longitude: number,
248
219
  latitude: number
249
- ): Promise<BDMsgEncryptResponse[]> =>
250
- BeiDouBluetoothModule.positionEmergencyBDMsgEncrypt(slotId, speedType, receiveList, inputMsg, longitude, latitude);
251
-
252
- export const encryptCommonRichMediaBeiDouMessage = async (
253
- slotId: number = 0,
254
- speedType: string = '0',
255
- receiveList: string[],
256
- msgType: string,
257
- inputRichMediaData: number[]
258
- ): Promise<BDMsgEncryptResponse[]> =>
259
- BeiDouBluetoothModule.commonRichMediaBDMsgEncrypt(slotId, speedType, receiveList, msgType, inputRichMediaData);
260
-
261
- export const encryptPositionRichMediaBeiDouMessage = async (
262
- slotId: number = 0,
263
- speedType: string = '0',
264
- receiveList: string[],
265
- msgType: string,
266
- inputRichMediaData: number[],
267
- longitude: number,
268
- latitude: number
269
- ): Promise<BDMsgEncryptResponse[]> =>
270
- BeiDouBluetoothModule.positionRichMediaBDMsgEncrypt(
271
- slotId,
272
- speedType,
273
- receiveList,
274
- msgType,
275
- inputRichMediaData,
276
- longitude,
277
- latitude
278
- );
279
-
280
- export const encryptCommonRichMediaAndTextBeiDouMessage = async (
281
- slotId: number = 0,
282
- speedType: string = '0',
283
- receiveList: string[],
284
- text: string,
285
- msgType: string,
286
- inputRichMediaData: number[]
287
- ): Promise<BDMsgEncryptResponse[]> =>
288
- BeiDouBluetoothModule.commonRichMediaAndTextBDMsgEncrypt(
289
- slotId,
290
- speedType,
291
- receiveList,
292
- text,
293
- msgType,
294
- inputRichMediaData
295
- );
296
-
297
- export const encryptPositionRichMediaAndTextBeiDouMessage = async (
298
- slotId: number = 0,
299
- speedType: string = '0',
300
- receiveList: string[],
301
- text: string,
302
- msgType: string,
303
- inputRichMediaData: number[],
304
- longitude: number,
305
- latitude: number
306
- ): Promise<BDMsgEncryptResponse[]> =>
307
- BeiDouBluetoothModule.positionRichMediaAndTextBDMsgEncrypt(
308
- slotId,
309
- speedType,
310
- receiveList,
311
- text,
312
- msgType,
313
- inputRichMediaData,
314
- longitude,
315
- latitude
316
- );
220
+ ): Promise<BDMsgEncryptResponse> => {
221
+ return await BeiDouBluetoothModule.positionBDMsgEncrypt(slotId, receiveList, inputMsg, longitude, latitude);
222
+ };
317
223
 
318
224
  /**
319
225
  * 北斗信箱查询请求加密
320
226
  */
321
- export const encryptBeiDouMailboxQuery = async (slotId: number = 0): Promise<BDMsgEncryptResponse> =>
322
- BeiDouBluetoothModule.BDMailboxQueryEncrypt(slotId);
323
-
324
- export const encryptEmergencyBeiDouMailboxQuery = async (
325
- slotId: number = 0,
326
- replyMobile: string
327
- ): Promise<BDMsgEncryptResponse> => BeiDouBluetoothModule.EmergencyBDMailboxQueryEncrypt(slotId, replyMobile);
227
+ export const encryptBeiDouMailboxQuery = async (slotId: number): Promise<BDMsgEncryptResponse> => {
228
+ return await BeiDouBluetoothModule.BDMailboxQueryEncrypt(slotId);
229
+ };
328
230
 
329
231
  /**
330
232
  * 北斗报文解密
331
233
  */
332
234
  export const decryptBeiDouMessage = async (
333
- slotId: number = 0,
235
+ slotId: number,
334
236
  msg: number[],
335
237
  len: number
336
- ): Promise<BDMsgDecryptResponse> => BeiDouBluetoothModule.BDMsgDecrypt(slotId, msg, len);
238
+ ): Promise<BDMsgDecryptResponse> => {
239
+ return await BeiDouBluetoothModule.BDMsgDecrypt(slotId, msg, len);
240
+ };
337
241
 
338
242
  /**
339
243
  * 下载北斗星历文件
340
244
  */
341
245
  export const downloadEphemerisFile = async (
342
- slotId: number = 0,
246
+ slotId: number,
343
247
  type: string,
344
248
  version: string
345
- ): Promise<BDMsgEphemerisFileDLResponse> => BeiDouBluetoothModule.DLEphemerisFile(slotId, type, version);
249
+ ): Promise<BDMsgEphemerisFileDLResponse> => {
250
+ return await BeiDouBluetoothModule.DLEphemerisFile(slotId, type, version);
251
+ };
346
252
 
347
253
  // ================== 新增iOS兼容方法的便利函数 ==================
348
254
 
@@ -465,78 +371,14 @@ export const BeiDouModule = {
465
371
  unbindService: unbindBeiDouService,
466
372
 
467
373
  // 核心功能
468
- authenticate: (slotId: number = 0) => authenticateBeiDou(slotId),
469
- getStatus: (slotId: number = 0) => getBeiDouStatus(slotId),
470
- checkKey: (slotId: number = 0) => checkBeiDouKey(slotId),
471
- encryptCommonMessage: (
472
- slotId: number,
473
- speedType: string,
474
- receiveList: string[],
475
- inputMsg: string
476
- ) => encryptCommonBeiDouMessage(slotId, speedType, receiveList, inputMsg),
477
- encryptPositionMessage: (
478
- slotId: number,
479
- speedType: string,
480
- receiveList: string[],
481
- inputMsg: string,
482
- longitude: number,
483
- latitude: number
484
- ) => encryptPositionBeiDouMessage(slotId, speedType, receiveList, inputMsg, longitude, latitude),
485
- encryptCommonEmergencyMessage: (
486
- slotId: number,
487
- speedType: string,
488
- receiveList: string[],
489
- inputMsg: string
490
- ) => encryptCommonEmergencyBeiDouMessage(slotId, speedType, receiveList, inputMsg),
491
- encryptPositionEmergencyMessage: (
492
- slotId: number,
493
- speedType: string,
494
- receiveList: string[],
495
- inputMsg: string,
496
- longitude: number,
497
- latitude: number
498
- ) => encryptPositionEmergencyBeiDouMessage(slotId, speedType, receiveList, inputMsg, longitude, latitude),
499
- encryptCommonRichMediaMessage: (
500
- slotId: number,
501
- speedType: string,
502
- receiveList: string[],
503
- msgType: string,
504
- data: number[]
505
- ) => encryptCommonRichMediaBeiDouMessage(slotId, speedType, receiveList, msgType, data),
506
- encryptPositionRichMediaMessage: (
507
- slotId: number,
508
- speedType: string,
509
- receiveList: string[],
510
- msgType: string,
511
- data: number[],
512
- longitude: number,
513
- latitude: number
514
- ) => encryptPositionRichMediaBeiDouMessage(slotId, speedType, receiveList, msgType, data, longitude, latitude),
515
- encryptCommonRichMediaAndTextMessage: (
516
- slotId: number,
517
- speedType: string,
518
- receiveList: string[],
519
- text: string,
520
- msgType: string,
521
- data: number[]
522
- ) => encryptCommonRichMediaAndTextBeiDouMessage(slotId, speedType, receiveList, text, msgType, data),
523
- encryptPositionRichMediaAndTextMessage: (
524
- slotId: number,
525
- speedType: string,
526
- receiveList: string[],
527
- text: string,
528
- msgType: string,
529
- data: number[],
530
- longitude: number,
531
- latitude: number
532
- ) =>
533
- encryptPositionRichMediaAndTextBeiDouMessage(slotId, speedType, receiveList, text, msgType, data, longitude, latitude),
534
- encryptMailboxQuery: (slotId: number = 0) => encryptBeiDouMailboxQuery(slotId),
535
- encryptEmergencyMailboxQuery: (replyMobile: string, slotId: number = 0) =>
536
- encryptEmergencyBeiDouMailboxQuery(slotId, replyMobile),
537
- decryptMessage: (msg: number[], len: number, slotId: number = 0) => decryptBeiDouMessage(slotId, msg, len),
538
- downloadEphemeris: (type: string, version: string, slotId: number = 0) =>
539
- downloadEphemerisFile(slotId, type, version),
374
+ authenticate: authenticateBeiDou,
375
+ getStatus: getBeiDouStatus,
376
+ checkKey: checkBeiDouKey,
377
+ encryptCommonMessage: encryptCommonBeiDouMessage,
378
+ encryptPositionMessage: encryptPositionBeiDouMessage,
379
+ encryptMailboxQuery: encryptBeiDouMailboxQuery,
380
+ decryptMessage: decryptBeiDouMessage,
381
+ downloadEphemeris: downloadEphemerisFile,
540
382
  },
541
383
 
542
384
  // 所有原生方法的原名导出
@@ -574,14 +416,7 @@ export const BeiDouModule = {
574
416
  checkValidatedKey: BeiDouBluetoothModule.checkValidatedKey,
575
417
  commonBDMsgEncrypt: BeiDouBluetoothModule.commonBDMsgEncrypt,
576
418
  positionBDMsgEncrypt: BeiDouBluetoothModule.positionBDMsgEncrypt,
577
- commonEmergencyBDMsgEncrypt: BeiDouBluetoothModule.commonEmergencyBDMsgEncrypt,
578
- positionEmergencyBDMsgEncrypt: BeiDouBluetoothModule.positionEmergencyBDMsgEncrypt,
579
- commonRichMediaBDMsgEncrypt: BeiDouBluetoothModule.commonRichMediaBDMsgEncrypt,
580
- positionRichMediaBDMsgEncrypt: BeiDouBluetoothModule.positionRichMediaBDMsgEncrypt,
581
- commonRichMediaAndTextBDMsgEncrypt: BeiDouBluetoothModule.commonRichMediaAndTextBDMsgEncrypt,
582
- positionRichMediaAndTextBDMsgEncrypt: BeiDouBluetoothModule.positionRichMediaAndTextBDMsgEncrypt,
583
419
  BDMailboxQueryEncrypt: BeiDouBluetoothModule.BDMailboxQueryEncrypt,
584
- EmergencyBDMailboxQueryEncrypt: BeiDouBluetoothModule.EmergencyBDMailboxQueryEncrypt,
585
420
  BDMsgDecrypt: BeiDouBluetoothModule.BDMsgDecrypt,
586
421
  DLEphemerisFile: BeiDouBluetoothModule.DLEphemerisFile,
587
422
  getGpsLocation: (): Promise<{
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>NSPrivacyTracking</key>
6
- <false/>
7
- <key>NSPrivacyTrackingDomains</key>
8
- <array/>
9
- <key>NSPrivacyCollectedDataTypes</key>
10
- <array/>
11
- <key>NSPrivacyAccessedAPITypes</key>
12
- <array/>
13
- </dict>
14
- </plist>
@@ -4,11 +4,11 @@
4
4
  <dict>
5
5
  <key>files</key>
6
6
  <dict>
7
- <key>FMDB.bundle/Info.plist</key>
7
+ <key>FMDB_Privacy.bundle/Info.plist</key>
8
8
  <data>
9
- fQm/OgDmwDzxKX8rvFINy7CJkJ4=
9
+ WBxEhayK9LDcuBGPgDElRCnpskE=
10
10
  </data>
11
- <key>FMDB.bundle/PrivacyInfo.xcprivacy</key>
11
+ <key>FMDB_Privacy.bundle/PrivacyInfo.xcprivacy</key>
12
12
  <data>
13
13
  ucg9pita0v8d353x3NuGfxweQYU=
14
14
  </data>
@@ -34,7 +34,7 @@
34
34
  </data>
35
35
  <key>Info.plist</key>
36
36
  <data>
37
- XA4b0GI82DRY0I4G277GU6YcIDc=
37
+ wyYu4OM1CFn36F1aZLvvpdnzVkU=
38
38
  </data>
39
39
  <key>Modules/module.modulemap</key>
40
40
  <data>
@@ -43,18 +43,18 @@
43
43
  </dict>
44
44
  <key>files2</key>
45
45
  <dict>
46
- <key>FMDB.bundle/Info.plist</key>
46
+ <key>FMDB_Privacy.bundle/Info.plist</key>
47
47
  <dict>
48
48
  <key>hash</key>
49
49
  <data>
50
- fQm/OgDmwDzxKX8rvFINy7CJkJ4=
50
+ WBxEhayK9LDcuBGPgDElRCnpskE=
51
51
  </data>
52
52
  <key>hash2</key>
53
53
  <data>
54
- BeV82aZzyEQ+5IJExHzOKtyngMdCpF/kTedm1V+R9cA=
54
+ 9SmgHWbqq7xIPq+R9Pt3UBnSpjJTszWfl88E+GH/Ea8=
55
55
  </data>
56
56
  </dict>
57
- <key>FMDB.bundle/PrivacyInfo.xcprivacy</key>
57
+ <key>FMDB_Privacy.bundle/PrivacyInfo.xcprivacy</key>
58
58
  <dict>
59
59
  <key>hash</key>
60
60
  <data>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-beidou",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "A React Native module for BeiDou Bluetooth communication.",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = "react-native-beidou"
3
- s.version = "1.1.2" # 与 package.json 中的版本保持一致
3
+ s.version = "1.1.4" # 与 package.json 中的版本保持一致
4
4
  s.summary = "React Native Beidou Module"
5
5
  s.description = <<-DESC
6
6
  A React Native module for Beidou functionality.
@@ -8,8 +8,11 @@ Pod::Spec.new do |s|
8
8
  s.homepage = "https://www.npmjs.com/package/react-native-beidou" # 替换为实际地址
9
9
  s.license = { :type => "MIT", :file => "LICENSE" }
10
10
  s.author = { "David" => "mr_jianwei@163.com" } # 替换为你的信息
11
- s.platform = :ios, "11.0"
12
- s.source = { :path => "." }
11
+ s.platform = :ios, "15.6"
12
+ s.source = {
13
+ :git => "https://www.npmjs.com/package/react-native-beidou.git",
14
+ :branch => "main"
15
+ }
13
16
 
14
17
  # 指定源文件路径
15
18
  s.source_files = "ios/**/*.{h,m,mm,swift}"