mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-25 20:56:45 +10:00
Add Jpush
This commit is contained in:
@@ -2,4 +2,5 @@ source 'https://github.com/CocoaPods/Specs.git'
|
||||
platform :ios, '8.0'
|
||||
use_frameworks!
|
||||
|
||||
#pod 'JPushSDK'
|
||||
pod 'Realm'
|
||||
|
||||
@@ -12,6 +12,18 @@
|
||||
0A8F54B81AB67D11004AD60E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0A8F54B71AB67D11004AD60E /* Images.xcassets */; };
|
||||
0A8F54BB1AB67D11004AD60E /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0A8F54B91AB67D11004AD60E /* LaunchScreen.xib */; };
|
||||
0A8F54C71AB67D11004AD60E /* YepTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A8F54C61AB67D11004AD60E /* YepTests.swift */; };
|
||||
0AD7EA5C1AC3ECD700617758 /* libPushSDK-1.8.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA5B1AC3ECD700617758 /* libPushSDK-1.8.3.a */; };
|
||||
0AD7EA5E1AC3ED1200617758 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA5D1AC3ED1200617758 /* CFNetwork.framework */; };
|
||||
0AD7EA601AC3ED1900617758 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA5F1AC3ED1900617758 /* CoreFoundation.framework */; };
|
||||
0AD7EA621AC3ED2100617758 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA611AC3ED2100617758 /* CoreTelephony.framework */; };
|
||||
0AD7EA641AC3ED2A00617758 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA631AC3ED2A00617758 /* SystemConfiguration.framework */; };
|
||||
0AD7EA661AC3ED3000617758 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA651AC3ED3000617758 /* CoreGraphics.framework */; };
|
||||
0AD7EA681AC3ED3600617758 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA671AC3ED3600617758 /* Foundation.framework */; };
|
||||
0AD7EA6A1AC3ED3D00617758 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA691AC3ED3D00617758 /* UIKit.framework */; };
|
||||
0AD7EA6C1AC3ED4300617758 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA6B1AC3ED4300617758 /* Security.framework */; };
|
||||
0AD7EA6E1AC3ED4A00617758 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA6D1AC3ED4A00617758 /* libz.dylib */; };
|
||||
0AD7EA741AC3EE9600617758 /* libPushSDK-1.8.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AD7EA731AC3EE9600617758 /* libPushSDK-1.8.3.a */; };
|
||||
0AD7EA771AC3EEB000617758 /* PushConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0AD7EA761AC3EEB000617758 /* PushConfig.plist */; };
|
||||
15606C18E1487982869C0A42 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD88F6095DB46DFAD41AB5DB /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
50165C451AC2860900C7AEBE /* ConversationLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50165C441AC2860900C7AEBE /* ConversationLayout.swift */; };
|
||||
5023DE261AB6856300B3EE96 /* ConversationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5023DE251AB6856300B3EE96 /* ConversationsViewController.swift */; };
|
||||
@@ -82,6 +94,21 @@
|
||||
0A8F54C01AB67D11004AD60E /* YepTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YepTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
0A8F54C51AB67D11004AD60E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
0A8F54C61AB67D11004AD60E /* YepTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YepTests.swift; sourceTree = "<group>"; };
|
||||
0AD7EA511AC3EA6F00617758 /* JPushSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JPushSDK.framework; path = "Pods/../build/Debug-iphoneos/Pods/JPushSDK.framework"; sourceTree = "<group>"; };
|
||||
0AD7EA581AC3EAF300617758 /* Yep-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Yep-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
0AD7EA5B1AC3ECD700617758 /* libPushSDK-1.8.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPushSDK-1.8.3.a"; path = "Yep/lib/libPushSDK-1.8.3.a"; sourceTree = "<group>"; };
|
||||
0AD7EA5D1AC3ED1200617758 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
|
||||
0AD7EA5F1AC3ED1900617758 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
|
||||
0AD7EA611AC3ED2100617758 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
|
||||
0AD7EA631AC3ED2A00617758 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||
0AD7EA651AC3ED3000617758 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
0AD7EA671AC3ED3600617758 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
0AD7EA691AC3ED3D00617758 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
0AD7EA6B1AC3ED4300617758 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
0AD7EA6D1AC3ED4A00617758 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
|
||||
0AD7EA721AC3EE9600617758 /* APService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = APService.h; path = JPush/APService.h; sourceTree = "<group>"; };
|
||||
0AD7EA731AC3EE9600617758 /* libPushSDK-1.8.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPushSDK-1.8.3.a"; path = "JPush/libPushSDK-1.8.3.a"; sourceTree = "<group>"; };
|
||||
0AD7EA761AC3EEB000617758 /* PushConfig.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PushConfig.plist; path = JPush/PushConfig.plist; sourceTree = "<group>"; };
|
||||
2268251A75FF6766DC31CCFB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
50165C441AC2860900C7AEBE /* ConversationLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ConversationLayout.swift; path = ViewControllers/Conversation/ConversationLayout.swift; sourceTree = "<group>"; };
|
||||
5023DE251AB6856300B3EE96 /* ConversationsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ConversationsViewController.swift; path = ViewControllers/Conversations/ConversationsViewController.swift; sourceTree = "<group>"; };
|
||||
@@ -139,6 +166,17 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0AD7EA6E1AC3ED4A00617758 /* libz.dylib in Frameworks */,
|
||||
0AD7EA6C1AC3ED4300617758 /* Security.framework in Frameworks */,
|
||||
0AD7EA6A1AC3ED3D00617758 /* UIKit.framework in Frameworks */,
|
||||
0AD7EA741AC3EE9600617758 /* libPushSDK-1.8.3.a in Frameworks */,
|
||||
0AD7EA681AC3ED3600617758 /* Foundation.framework in Frameworks */,
|
||||
0AD7EA661AC3ED3000617758 /* CoreGraphics.framework in Frameworks */,
|
||||
0AD7EA641AC3ED2A00617758 /* SystemConfiguration.framework in Frameworks */,
|
||||
0AD7EA621AC3ED2100617758 /* CoreTelephony.framework in Frameworks */,
|
||||
0AD7EA601AC3ED1900617758 /* CoreFoundation.framework in Frameworks */,
|
||||
0AD7EA5E1AC3ED1200617758 /* CFNetwork.framework in Frameworks */,
|
||||
0AD7EA5C1AC3ECD700617758 /* libPushSDK-1.8.3.a in Frameworks */,
|
||||
15606C18E1487982869C0A42 /* Pods.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -177,6 +215,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0A8F54B01AB67D11004AD60E /* AppDelegate.swift */,
|
||||
0AD7EA581AC3EAF300617758 /* Yep-Bridging-Header.h */,
|
||||
50E114F51ABBF9D100F13000 /* Realm */,
|
||||
502AE53B1AB871C5005BD199 /* Helpers */,
|
||||
502AE52C1AB819B5005BD199 /* Configs */,
|
||||
@@ -197,6 +236,7 @@
|
||||
0A8F54AE1AB67D11004AD60E /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0AD7EA751AC3EE9B00617758 /* JPush */,
|
||||
0A8F54AF1AB67D11004AD60E /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
@@ -219,6 +259,16 @@
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0AD7EA751AC3EE9B00617758 /* JPush */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0AD7EA721AC3EE9600617758 /* APService.h */,
|
||||
0AD7EA731AC3EE9600617758 /* libPushSDK-1.8.3.a */,
|
||||
0AD7EA761AC3EEB000617758 /* PushConfig.plist */,
|
||||
);
|
||||
name = JPush;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5023DE271AB6856600B3EE96 /* ViewControllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -517,6 +567,17 @@
|
||||
67B708B60AAD1DEA82A6A682 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0AD7EA6D1AC3ED4A00617758 /* libz.dylib */,
|
||||
0AD7EA6B1AC3ED4300617758 /* Security.framework */,
|
||||
0AD7EA691AC3ED3D00617758 /* UIKit.framework */,
|
||||
0AD7EA671AC3ED3600617758 /* Foundation.framework */,
|
||||
0AD7EA651AC3ED3000617758 /* CoreGraphics.framework */,
|
||||
0AD7EA631AC3ED2A00617758 /* SystemConfiguration.framework */,
|
||||
0AD7EA611AC3ED2100617758 /* CoreTelephony.framework */,
|
||||
0AD7EA5F1AC3ED1900617758 /* CoreFoundation.framework */,
|
||||
0AD7EA5D1AC3ED1200617758 /* CFNetwork.framework */,
|
||||
0AD7EA5B1AC3ECD700617758 /* libPushSDK-1.8.3.a */,
|
||||
0AD7EA511AC3EA6F00617758 /* JPushSDK.framework */,
|
||||
FD88F6095DB46DFAD41AB5DB /* Pods.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
@@ -618,6 +679,7 @@
|
||||
0A8F54B81AB67D11004AD60E /* Images.xcassets in Resources */,
|
||||
502AE5191AB70D72005BD199 /* Intro.storyboard in Resources */,
|
||||
503315981AC1017E0008A209 /* ChatLeftTextCell.xib in Resources */,
|
||||
0AD7EA771AC3EEB000617758 /* PushConfig.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -858,10 +920,21 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/build/Debug-iphoneos/Pods",
|
||||
);
|
||||
INFOPLIST_FILE = Yep/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)",
|
||||
"$(PROJECT_DIR)/Yep/lib",
|
||||
"$(PROJECT_DIR)/Yep/JPush",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Yep/Yep-Bridging-Header.h";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -871,10 +944,21 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/build/Debug-iphoneos/Pods",
|
||||
);
|
||||
INFOPLIST_FILE = Yep/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)",
|
||||
"$(PROJECT_DIR)/Yep/lib",
|
||||
"$(PROJECT_DIR)/Yep/JPush",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Yep/Yep-Bridging-Header.h";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import JPushSDK
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
@@ -29,7 +30,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
if !isLogined {
|
||||
startIntroStory()
|
||||
}
|
||||
|
||||
|
||||
APService.setupWithOption(launchOptions)
|
||||
|
||||
// let storyboard = UIStoryboard(name: "Intro", bundle: nil)
|
||||
// let rootViewController = storyboard.instantiateViewControllerWithIdentifier("RegisterPickAvatarViewController") as! RegisterPickAvatarViewController
|
||||
@@ -40,6 +42,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
if let token = YepUserDefaults.v1AccessToken() {
|
||||
sync()
|
||||
}
|
||||
|
||||
APService.registerForRemoteNotificationTypes(UIUserNotificationType.Badge.rawValue | UIUserNotificationType.Badge.rawValue | UIUserNotificationType.Alert.rawValue , categories: nil)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
//
|
||||
// APService.h
|
||||
// APService
|
||||
//
|
||||
// Created by JPush on 12-8-15.
|
||||
// Copyright (c) 2012年 HXHG. All rights reserved.
|
||||
// Version: 1.8.3
|
||||
|
||||
@class CLRegion;
|
||||
@class UILocalNotification;
|
||||
|
||||
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;
|
||||
@interface APService : NSObject
|
||||
|
||||
#pragma - mark 基本功能
|
||||
// 以下四个接口是必须调用的
|
||||
+ (void)setupWithOption:(NSDictionary *)launchingOption; // 初始化
|
||||
+ (void)registerForRemoteNotificationTypes:(NSUInteger)types
|
||||
categories:(NSSet *)categories; // 注册APNS类型
|
||||
+ (void)registerDeviceToken:(NSData *)deviceToken; // 向服务器上报Device Token
|
||||
+ (void)handleRemoteNotification:(NSDictionary *)
|
||||
remoteInfo; // 处理收到的APNS消息,向服务器上报收到APNS消息
|
||||
|
||||
// 下面的接口是可选的
|
||||
// 设置标签和(或)别名(若参数为nil,则忽略;若是空对象,则清空;详情请参考文档:http://docs.jpush.cn/pages/viewpage.action?pageId=3309913)
|
||||
+ (void)setTags:(NSSet *)tags
|
||||
alias:(NSString *)alias
|
||||
callbackSelector:(SEL)cbSelector
|
||||
target:(id)theTarget;
|
||||
+ (void)setTags:(NSSet *)tags
|
||||
alias:(NSString *)alias
|
||||
callbackSelector:(SEL)cbSelector
|
||||
object:(id)theTarget;
|
||||
+ (void)setTags:(NSSet *)tags
|
||||
callbackSelector:(SEL)cbSelector
|
||||
object:(id)theTarget;
|
||||
+ (void)setAlias:(NSString *)alias
|
||||
callbackSelector:(SEL)cbSelector
|
||||
object:(id)theTarget;
|
||||
// 用于过滤出正确可用的tags,如果总数量超出最大限制则返回最大数量的靠前的可用tags
|
||||
+ (NSSet *)filterValidTags:(NSSet *)tags;
|
||||
|
||||
#pragma - mark 上报日志
|
||||
/**
|
||||
* 记录页面停留时间功能。
|
||||
* startLogPageView和stopLogPageView为自动计算停留时间
|
||||
* beginLogPageView为手动自己输入停留时间
|
||||
*
|
||||
* @param pageName 页面名称
|
||||
* @param seconds 页面停留时间
|
||||
*/
|
||||
+ (void)startLogPageView:(NSString *)pageName;
|
||||
+ (void)stopLogPageView:(NSString *)pageName;
|
||||
+ (void)beginLogPageView:(NSString *)pageName duration:(int)seconds;
|
||||
|
||||
/**
|
||||
* 开启Crash日志收集, 默认是关闭状态.
|
||||
*/
|
||||
+ (void)crashLogON;
|
||||
|
||||
/**
|
||||
* 地理位置设置
|
||||
* 为了更精确的统计用户地理位置,可以调用此方法传入经纬度信息
|
||||
* 需要链接 CoreLocation.framework 并且 #import <CoreLocation/CoreLocation.h>
|
||||
* @param latitude 纬度.
|
||||
* @param longitude 经度.
|
||||
* @param location 直接传递CLLocation *型的地理信息
|
||||
*/
|
||||
+ (void)setLatitude:(double)latitude longitude:(double)longitude;
|
||||
+ (void)setLocation:(CLLocation *)location;
|
||||
|
||||
#pragma - mark 本地通知
|
||||
/**
|
||||
* 本地推送,最多支持64个
|
||||
* @param fireDate 本地推送触发的时间
|
||||
* @param alertBody 本地推送需要显示的内容
|
||||
* @param badge 角标的数字。如果不需要改变角标传-1
|
||||
* @param alertAction 弹框的按钮显示的内容(IOS 8默认为"打开",其他默认为"启动")
|
||||
* @param notificationKey 本地推送标示符
|
||||
* @param userInfo 自定义参数,可以用来标识推送和增加附加信息
|
||||
* @param soundName 自定义通知声音,设置为nil为默认声音
|
||||
|
||||
* 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;
|
||||
|
||||
+ (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);
|
||||
|
||||
/**
|
||||
* 本地推送在前台推送。默认App在前台运行时不会进行弹窗,在程序接收通知调用此接口可实现指定的推送弹窗。
|
||||
* @param notification 本地推送对象
|
||||
* @param notificationKey 需要前台显示的本地推送通知的标示符
|
||||
*/
|
||||
+ (void)showLocalNotificationAtFront:(UILocalNotification *)notification
|
||||
identifierKey:(NSString *)notificationKey;
|
||||
/**
|
||||
* 删除本地推送
|
||||
* @param notificationKey 本地推送标示符
|
||||
* @param myUILocalNotification 本地推送对象
|
||||
*/
|
||||
+ (void)deleteLocalNotificationWithIdentifierKey:(NSString *)notificationKey;
|
||||
+ (void)deleteLocalNotification:(UILocalNotification *)localNotification;
|
||||
|
||||
/**
|
||||
* 获取指定通知
|
||||
* @param notificationKey 本地推送标示符
|
||||
* @return 本地推送对象数组,[array count]为0时表示没找到
|
||||
*/
|
||||
+ (NSArray *)findLocalNotificationWithIdentifier:(NSString *)notificationKey;
|
||||
|
||||
/**
|
||||
* 清除所有本地推送对象
|
||||
*/
|
||||
+ (void)clearAllLocalNotifications;
|
||||
|
||||
#pragma - mark 设置Badge
|
||||
/**
|
||||
* set setBadge
|
||||
* @param value 设置JPush服务器的badge的值
|
||||
* 本地仍须调用UIApplication:setApplicationIconBadgeNumber函数,来设置脚标
|
||||
*/
|
||||
+ (BOOL)setBadge:(NSInteger)value;
|
||||
/**
|
||||
* set setBadge
|
||||
* @param value 清除JPush服务器对badge值的设定.
|
||||
* 本地仍须调用UIApplication:setApplicationIconBadgeNumber函数,来设置脚标
|
||||
*/
|
||||
|
||||
+ (void)resetBadge;
|
||||
|
||||
/**
|
||||
* get RegistrationID
|
||||
*/
|
||||
+ (NSString *)registrationID;
|
||||
|
||||
#pragma - mark 打印日志信息配置
|
||||
/**
|
||||
* setDebugMode获取更多的Log信息
|
||||
* 开发过程中建议开启DebugMode
|
||||
*
|
||||
* setLogOFF关闭除了错误信息外的所有Log
|
||||
* 发布时建议开启LogOFF用于节省性能开销
|
||||
*
|
||||
* 默认为不开启DebugLog,只显示基本的信息
|
||||
*/
|
||||
+ (void)setDebugMode;
|
||||
+ (void)setLogOFF;
|
||||
@end
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>APS_FOR_PRODUCTION</key>
|
||||
<string>0</string>
|
||||
<key>CHANNEL</key>
|
||||
<string>AppStore</string>
|
||||
<key>APP_KEY</key>
|
||||
<string>e521aa97cd4cd4eba5b73669</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
#import <JPushSDK/APService.h>
|
||||
Reference in New Issue
Block a user