Skip to content

Commit 890587b

Browse files
Merge pull request #530 from jpush/dev
Dev
2 parents cffba79 + 5d4bd0d commit 890587b

File tree

5 files changed

+32
-13
lines changed

5 files changed

+32
-13
lines changed

index.d.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ interface JInfoMap {
66
myVersion: string
77
}
88

9+
type ExtraData = {
10+
[key: string]: any
11+
}
12+
13+
interface LocalNotificationOptions {
14+
buildId: 1 | 2 // 设置通知样式,1 为基础样式,2 为自定义样式。自定义样式需要先调用 setStyleCustom 接口设置自定义样式。(Android Only)
15+
id: number // 通知的 id, 可用于取消通知
16+
title: string // 通知标题
17+
content: string // 通知内容
18+
fireTime: number // 通知触发时间的时间戳(毫秒)
19+
extra?: ExtraData // extra 字段
20+
badge?: number // 本地推送触发后应用角标的 badge 值 (iOS Only)
21+
soundName?: string // 指定推送的音频文件 (iOS Only)
22+
subtitle?: string // 子标题 (iOS10+ Only)
23+
}
24+
925
type JSuccessCallback<T = undefined> = (result: T) => void
1026
type JFailCallback = (result: { errorCode: number }) => void
1127
type JResultCallback<T = undefined> = (result: T) => void
@@ -291,7 +307,7 @@ declare class JPush {
291307
* 'subtitle': String // 子标题 (iOS10+ Only)
292308
* }
293309
*/
294-
static sendLocalNotification(notification: Object): void
310+
static sendLocalNotification(notification: LocalNotificationOptions): void
295311

296312
/**
297313
* iOS Only

ios/RCTJPushModule.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
624386D71E096B8800F69E07 /* RCTJPushActionQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 624386D21E096B8800F69E07 /* RCTJPushActionQueue.m */; };
1111
624386D81E096B8800F69E07 /* RCTJPushModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 624386D41E096B8800F69E07 /* RCTJPushModule.m */; };
12-
62854FE720F76769001F09E3 /* libjpush-ios-3.0.9.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 62854FE620F76769001F09E3 /* libjpush-ios-3.0.9.a */; };
12+
6296D38521251A7600E77B5E /* libjpush-ios-3.1.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6296D38321251A7600E77B5E /* libjpush-ios-3.1.0.a */; };
1313
/* End PBXBuildFile section */
1414

1515
/* Begin PBXCopyFilesBuildPhase section */
@@ -30,16 +30,16 @@
3030
624386D31E096B8800F69E07 /* RCTJPushModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJPushModule.h; sourceTree = "<group>"; };
3131
624386D41E096B8800F69E07 /* RCTJPushModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJPushModule.m; sourceTree = "<group>"; };
3232
6280980A1CEDC407000D3A81 /* libRCTJPushModule.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTJPushModule.a; sourceTree = BUILT_PRODUCTS_DIR; };
33-
62854FE520F76769001F09E3 /* JPUSHService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JPUSHService.h; sourceTree = "<group>"; };
34-
62854FE620F76769001F09E3 /* libjpush-ios-3.0.9.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libjpush-ios-3.0.9.a"; sourceTree = "<group>"; };
33+
6296D38321251A7600E77B5E /* libjpush-ios-3.1.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libjpush-ios-3.1.0.a"; sourceTree = "<group>"; };
34+
6296D38421251A7600E77B5E /* JPUSHService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JPUSHService.h; sourceTree = "<group>"; };
3535
/* End PBXFileReference section */
3636

3737
/* Begin PBXFrameworksBuildPhase section */
3838
628098071CEDC407000D3A81 /* Frameworks */ = {
3939
isa = PBXFrameworksBuildPhase;
4040
buildActionMask = 2147483647;
4141
files = (
42-
62854FE720F76769001F09E3 /* libjpush-ios-3.0.9.a in Frameworks */,
42+
6296D38521251A7600E77B5E /* libjpush-ios-3.1.0.a in Frameworks */,
4343
);
4444
runOnlyForDeploymentPostprocessing = 0;
4545
};
@@ -65,8 +65,8 @@
6565
6280980C1CEDC407000D3A81 /* RCTJPushModule */ = {
6666
isa = PBXGroup;
6767
children = (
68-
62854FE520F76769001F09E3 /* JPUSHService.h */,
69-
62854FE620F76769001F09E3 /* libjpush-ios-3.0.9.a */,
68+
6296D38421251A7600E77B5E /* JPUSHService.h */,
69+
6296D38321251A7600E77B5E /* libjpush-ios-3.1.0.a */,
7070
624386D11E096B8800F69E07 /* RCTJPushActionQueue.h */,
7171
624386D21E096B8800F69E07 /* RCTJPushActionQueue.m */,
7272
624386D31E096B8800F69E07 /* RCTJPushModule.h */,

ios/RCTJPushModule/JPUSHService.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
1010
*/
1111

12-
#define JPUSH_VERSION_NUMBER 3.0.9
12+
#define JPUSH_VERSION_NUMBER 3.1.0
1313

1414
#import <Foundation/Foundation.h>
1515

@@ -304,23 +304,26 @@ typedef NS_OPTIONS(NSUInteger, JPAuthorizationOptions) {
304304
* @abstract 开始记录页面停留
305305
*
306306
* @param pageName 页面名称
307+
* @discussion JCore 1.1.8 版本后,如需统计页面流,请使用 JAnalytics
307308
*/
308-
+ (void)startLogPageView:(NSString *)pageName;
309+
+ (void)startLogPageView:(NSString *)pageName __attribute__((deprecated("JCore 1.1.8 版本已过期")));
309310

310311
/*!
311312
* @abstract 停止记录页面停留
312313
*
313314
* @param pageName 页面
315+
* @discussion JCore 1.1.8 版本后,如需统计页面流,请使用 JAnalytics
314316
*/
315-
+ (void)stopLogPageView:(NSString *)pageName;
317+
+ (void)stopLogPageView:(NSString *)pageName __attribute__((deprecated("JCore 1.1.8 版本已过期")));
316318

317319
/*!
318320
* @abstract 直接上报在页面的停留时间
319321
*
320322
* @param pageName 页面
321323
* @param seconds 停留的秒数
324+
* @discussion JCore 1.1.8 版本后,如需统计页面流,请使用 JAnalytics
322325
*/
323-
+ (void)beginLogPageView:(NSString *)pageName duration:(int)seconds;
326+
+ (void)beginLogPageView:(NSString *)pageName duration:(int)seconds __attribute__((deprecated("JCore 1.1.8 版本已过期")));
324327

325328
/*!
326329
* @abstract 开启Crash日志收集
@@ -375,7 +378,7 @@ typedef NS_OPTIONS(NSUInteger, JPAuthorizationOptions) {
375378
* @abstract 查找推送 (支持iOS10,并兼容iOS10以下版本)
376379
*
377380
* JPush 2.1.9新接口
378-
* @param identifier JPushNotificationIdentifier类型,iOS10以上可以通过设置identifier.delivered和identifier.identifiers来查找相应在通知中心显示推送或待推送请求,identifier.identifiers如果设置为nil或空数组则返回相应标志下所有在通知中心显示推送或待推送请求;iOS10以下identifier.delivered属性无效,identifier.identifiers如果设置nil或空数组则返回所有推送。须要设置identifier.findCompletionHandler回调才能得到查找结果,通过(NSArray *results)返回相应对象数组。
381+
* @param identifier JPushNotificationIdentifier类型,iOS10以上可以通过设置identifier.delivered和identifier.identifiers来查找相应在通知中心显示推送或待推送请求,identifier.identifiers如果设置为nil或空数组则返回相应标志下所有在通知中心显示推送或待推送请求;iOS10以下identifier.delivered属性无效,identifier.identifiers如果设置nil或空数组则返回所有未触发的推送。须要设置identifier.findCompletionHandler回调才能得到查找结果,通过(NSArray *results)返回相应对象数组。
379382
* @discussion 旧的查找推送接口被废弃,使用此接口可以替换
380383
*
381384
*/

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jpush-react-native",
3-
"version": "2.2.8",
3+
"version": "2.2.9",
44
"description": "a jpush plugin for react native application",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)