jpush-phonegap-plugin/src/ios/lib/JPUSHService.h

347 lines
12 KiB
C
Raw Normal View History

2016-01-21 15:15:48 +08:00
/*
* | | | | \ \ / / | | | | / _______|
* | |____| | \ \/ / | |____| | / /
* | |____| | \ / | |____| | | | _____
* | | | | / \ | | | | | | |____ |
* | | | | / /\ \ | | | | \ \______| |
* | | | | /_/ \_\ | | | | \_________|
*
* Copyright (c) 2011 ~ 2015 Shenzhen HXHG. All rights reserved.
*/
#define JPUSH_VERSION_NUMBER 2.1.8
2016-01-21 15:15:48 +08:00
#import <Foundation/Foundation.h>
@class CLRegion;
@class UILocalNotification;
extern NSString *const kJPFNetworkIsConnectingNotification; // 正在连接中
extern NSString *const kJPFNetworkDidSetupNotification; // 建立连接
extern NSString *const kJPFNetworkDidCloseNotification; // 关闭连接
extern NSString *const kJPFNetworkDidRegisterNotification; // 注册成功
extern NSString *const kJPFNetworkDidLoginNotification; // 登录成功
extern NSString *const kJPFNetworkDidReceiveMessageNotification; // 收到消息(非APNS)
extern NSString *const kJPFServiceErrorNotification; // 错误提示
@class CLLocation;
/*!
* JPush
*/
@interface JPUSHService : NSObject
///----------------------------------------------------
/// @name Setup 启动相关
///----------------------------------------------------
/*!
* @abstract SDK
*
* @discussion , PushConfig.plist . 使, .
*/
+ (void)setupWithOption:(NSDictionary *)launchingOption __attribute__((deprecated("JPush 2.1.0 版本已过期")));
/*!
* @abstract SDK
*
* @param launchingOption .
* @param appKey JPush ,. JPush .
* @param channel . .
* @param isProduction . , NO; , YES.
* @param advertisingIdentifier 广IDFA 使IDFAnil.
2016-01-21 15:15:48 +08:00
*
* @discussion SDK启动必须的参数, SDK.
* App , JPush SDK .
*/
+ (void)setupWithOption:(NSDictionary *)launchingOption
appKey:(NSString *)appKey
channel:(NSString *)channel
apsForProduction:(BOOL)isProduction;
+ (void)setupWithOption:(NSDictionary *)launchingOption
appKey:(NSString *)appKey
channel:(NSString *)channel
apsForProduction:(BOOL)isProduction
advertisingIdentifier:(NSString *)advertisingId;
2016-01-21 15:15:48 +08:00
///----------------------------------------------------
/// @name APNs about 通知相关
///----------------------------------------------------
/*!
* @abstract
*
* @param types
* @param categories
*
* @discussion
*/
+ (void)registerForRemoteNotificationTypes:(NSUInteger)types
categories:(NSSet *)categories;
+ (void)registerDeviceToken:(NSData *)deviceToken;
2016-01-21 15:15:48 +08:00
/*!
* @abstract APNs
*/
+ (void)handleRemoteNotification:(NSDictionary *)remoteInfo;
///----------------------------------------------------
/// @name Tag alias setting 设置别名与标签
///----------------------------------------------------
/*!
*
* ()nilhttp://docs.jpush.io/client/ios_api/#api-ios
* setTags:alias:fetchCompletionHandle:block里面处理设置结果即可.
* WARN: 使block时需要注意循环引用问题
*/
+ (void) setTags:(NSSet *)tags
alias:(NSString *)alias
callbackSelector:(SEL)cbSelector
target:(id)theTarget __attribute__((deprecated("JPush 2.1.1 版本已过期")));;
2016-01-21 15:15:48 +08:00
+ (void) setTags:(NSSet *)tags
alias:(NSString *)alias
callbackSelector:(SEL)cbSelector
object:(id)theTarget;
+ (void) setTags:(NSSet *)tags
callbackSelector:(SEL)cbSelector
object:(id)theTarget;
+ (void)setTags:(NSSet *)tags
alias:(NSString *)alias
fetchCompletionHandle:(void (^)(int iResCode, NSSet *iTags, NSString *iAlias))completionHandler;
2016-01-21 15:15:48 +08:00
+ (void) setTags:(NSSet *)tags
aliasInbackground:(NSString *)alias;
+ (void)setAlias:(NSString *)alias
callbackSelector:(SEL)cbSelector
object:(id)theTarget;
/*!
* @abstract tags
*
* @discussion tags , tags.
* tags . SDK .
*/
+ (NSSet *)filterValidTags:(NSSet *)tags;
///----------------------------------------------------
/// @name Stats 统计功能
///----------------------------------------------------
/*!
* @abstract
*
* @param pageName
*/
+ (void)startLogPageView:(NSString *)pageName;
/*!
* @abstract
*
* @param pageName
*/
+ (void)stopLogPageView:(NSString *)pageName;
/*!
* @abstract
*
* @param pageName
* @param seconds
*/
+ (void)beginLogPageView:(NSString *)pageName duration:(int)seconds;
/*!
* @abstract Crash日志收集
*
* @discussion .
*/
+ (void)crashLogON;
/*!
* @abstract
*
* @param latitude .
* @param longitude .
*
*/
+ (void)setLatitude:(double)latitude longitude:(double)longitude;
/*!
* @abstract
*
* @param location CLLocation *
*
* @discussion CoreLocation.framework #import <CoreLocation/CoreLocation.h>
*/
+ (void)setLocation:(CLLocation *)location;
///----------------------------------------------------
/// @name Local Notification 本地通知
///----------------------------------------------------
/*!
* @abstract 64
*
* @param fireDate
* @param alertBody
* @param badge -1
* @param alertAction IOS 8"打开", "启动"
* @param notificationKey
* @param userInfo
* @param soundName nil为默认声音
*
* @discussion 64
*/
+ (UILocalNotification *)setLocalNotification:(NSDate *)fireDate
alertBody:(NSString *)alertBody
badge:(int)badge
alertAction:(NSString *)alertAction
identifierKey:(NSString *)notificationKey
userInfo:(NSDictionary *)userInfo
soundName:(NSString *)soundName;
/*!
* @abstract ( iOS8 )
*
* IOS8新参数
* @param region
* @param regionTriggersOnce
* @param category
*/
+ (UILocalNotification *)setLocalNotification:(NSDate *)fireDate
alertBody:(NSString *)alertBody
badge:(int)badge
alertAction:(NSString *)alertAction
identifierKey:(NSString *)notificationKey
userInfo:(NSDictionary *)userInfo
soundName:(NSString *)soundName
region:(CLRegion *)region
regionTriggersOnce:(BOOL)regionTriggersOnce
category:(NSString *)category NS_AVAILABLE_IOS(8_0);
/*!
* @abstract
*
* @param notification
* @param notificationKey
*
* @discussion App在前台运行时不会进行弹窗
*/
+ (void)showLocalNotificationAtFront:(UILocalNotification *)notification
identifierKey:(NSString *)notificationKey;
/*!
* @abstract
*
* @param notificationKey
* @param myUILocalNotification
*/
+ (void)deleteLocalNotificationWithIdentifierKey:(NSString *)notificationKey;
/*!
* @abstract
*/
+ (void)deleteLocalNotification:(UILocalNotification *)localNotification;
/*!
* @abstract
*
* @param notificationKey
* @return , [array count]0
*/
+ (NSArray *)findLocalNotificationWithIdentifier:(NSString *)notificationKey;
/*!
* @abstract
*/
+ (void)clearAllLocalNotifications;
///----------------------------------------------------
/// @name Server badge 服务器端 badge 功能
///----------------------------------------------------
/*!
* @abstract ()
*
* @param value . ()
*
* @discussion .
* UIApplication:setApplicationIconBadgeNumber .
*
* JPush .
* , APNs , , .
*
* JPush :
*
* - API () badge ;
* - API APNs (),
* 使 "+1" , badge () +1 badge ;
*/
+ (BOOL)setBadge:(NSInteger)value;
/*!
* @abstract (0)
*
* @discussion [setBadge:0] .
* [JPUSHService setBadge:] .
*/
+ (void)resetBadge;
///----------------------------------------------------
/// @name Logs and others 日志与其他
///----------------------------------------------------
/*!
* @abstract JPush标识此设备的 registrationID
*
* @discussion SDK注册成功后, registrationID .
*
* JPush registrationID .
* , registrationID , , .
*
* JPush .
*/
+ (NSString *)registrationID;
/*!
* @abstract Debug
*
* @discussion JMessage iOS Android .
* : Verbose, Debug, Info, Warning, Error.
* , Android .
*
* SDK : Info. , .
*
* : Debug, .
*/
+ (void)setDebugMode;
/*!
* @abstract
*
* @discussion , [JPUSHService setDebugMode]
*
* , Warning, Error . , , .
*
* , , .
*/
+ (void)setLogOFF;
@end