feat: 自定义插件的更新
This commit is contained in:
160
Libs/ZPNs.framework/Headers/ZPNs.h
Normal file
160
Libs/ZPNs.framework/Headers/ZPNs.h
Normal file
@@ -0,0 +1,160 @@
|
||||
//
|
||||
// ZPNs.h
|
||||
// ZPNs
|
||||
//
|
||||
// Created by zego on 2021/9/28.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
//! Project version number for ZPNs.
|
||||
FOUNDATION_EXPORT double ZPNsVersionNumber;
|
||||
|
||||
//! Project version string for ZPNs.
|
||||
FOUNDATION_EXPORT const unsigned char ZPNsVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <ZPNs/PublicHeader.h>
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol ZPNsNotificationCenterDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/// Available since: 2.0.0 or later.
|
||||
|
||||
/// Description: This callback can be implemented to return the PushID generated by ZPNs after the [setDeviceToken] call.
|
||||
|
||||
/// Use cases: Developers can implement this callback if they need to get PushID after they connect to the SDK.
|
||||
|
||||
/// When to call /Trigger: This notification is triggered after a call to [setDeviceToken].
|
||||
///
|
||||
/// @param Pushid ZPNs generated pushID for offline push.
|
||||
- (void)onRegistered:(NSString *)Pushid;
|
||||
|
||||
/// Available since: 2.0.0 or later.
|
||||
|
||||
/// Description: This callback method is triggered when the application receives a push in the foreground.
|
||||
|
||||
/// Use cases: When the APP is in the foreground, the push received is not displayed by default. If the developer wants to do some business logic for the push received in the foreground, the callback method can be implemented to get the push information.
|
||||
|
||||
/// When to call /Trigger: Trigger this method when the APP is in the foreground and receives a remote push.
|
||||
///
|
||||
/// @param center // UNNotificationRequests can be scheduled using UNUserNotificationCenter. They can also be sent to the device from a server using Apple Push Notification Service. If the application is authorized then the UNNotificationRequest will be used to create a UNNotification and it will be used to notify the user. If the user acts on the UNNotification then a UNNotificationResponse will be sent to the application.
|
||||
/// @param notification iOS notification center object.
|
||||
/// @param userInfo Apps can set the userInfo for locally scheduled notification requests. The contents of the push payload will be set as the userInfo for remote notifications.
|
||||
/// @param completionHandler completionHandler.
|
||||
- (void)ZPNsNotificationCenter:(UNUserNotificationCenter *)center
|
||||
willPresentNotification:(UNNotification *)notification
|
||||
userInfo:(NSDictionary *)userInfo
|
||||
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
|
||||
API_AVAILABLE(macos(10.14), ios(10.0));
|
||||
|
||||
/// Available since: 2.0.0 and above.
|
||||
|
||||
/// Description: This callback method is triggered when the user clicks remote push to enter the APP.
|
||||
|
||||
/// Use cases: This approach can be implemented if developers want to implement some business logic after the user clicks on the remote push notification bar.
|
||||
|
||||
/// When to call /Trigger: When the user clicks remote push to enter the APP.
|
||||
///
|
||||
/// @param center // UNNotificationRequests can be scheduled using UNUserNotificationCenter. They can also be sent to the device from a server using Apple Push Notification Service. If the application is authorized then the UNNotificationRequest will be used to create a UNNotification and it will be used to notify the user. If the user acts on the UNNotification then a UNNotificationResponse will be sent to the application.
|
||||
/// @param response response.
|
||||
/// @param userInfo Apps can set the userInfo for locally scheduled notification requests. The contents of the push payload will be set as the userInfo for remote notifications.
|
||||
/// @param completionHandler completionHandler.
|
||||
- (void)ZPNsNotificationCenter:(UNUserNotificationCenter *)center
|
||||
didReceiveNotificationResponse:(UNNotificationResponse *)response
|
||||
userInfo:(NSDictionary *)userInfo
|
||||
withCompletionHandler:(void (^)(void))completionHandler
|
||||
API_AVAILABLE(macos(10.14), ios(10.0));
|
||||
@end
|
||||
|
||||
@interface ZPNsConfig : NSObject
|
||||
|
||||
@property (nonatomic, assign) unsigned int appType;
|
||||
|
||||
@end
|
||||
|
||||
@interface ZPNs : NSObject
|
||||
|
||||
/// Available since: 2.0.0 or later.
|
||||
|
||||
/// Description: return SDK Version.
|
||||
|
||||
/// When to call /Trigger: Called when you need to get the SDK version.
|
||||
+ (NSString *)getVersion;
|
||||
|
||||
/// Available since: 2.0.0 or later.
|
||||
///
|
||||
/// Description: Get the ZPNs instance.
|
||||
///
|
||||
/// Use cases: This method is used to obtain ZPNs singletons when ZPNs is used.
|
||||
+ (ZPNs *)shared;
|
||||
|
||||
/// Available since: 2.0.0 or later.
|
||||
|
||||
/// Description: In the class can be registered, with the APNs trigger iOS APPDelete didRegisterForRemoteNotificationsWithDeviceToken deviceToken method.
|
||||
|
||||
/// Use cases: You can call this interface when you need to get push functionality.
|
||||
|
||||
/// When to call /Trigger: To obtain the push function.
|
||||
|
||||
/// Restrictions: You need to use a networked iOS real machine to get the deviceToken correctly.
|
||||
- (void)registerAPNs;
|
||||
|
||||
- (void)unregisterAPNs;
|
||||
|
||||
- (void)setPushConfig:(nonnull ZPNsConfig *)config;
|
||||
|
||||
/// Available since: 2.0.0 or later.
|
||||
|
||||
/// Description: Use this method to pass deviceToken into ZPNs and get PushID.
|
||||
|
||||
/// Use cases: This method should be used after the official iOS interface didRegisterForRemoteNotificationsWithDeviceToken trigger, and on this interface will be incoming deviceToken parameters.
|
||||
|
||||
/// When to call /Trigger: Official iOS interface didRegisterForRemoteNotificationsWithDeviceToken trigger after use.
|
||||
|
||||
/// Caution: The isProduct Boolean value for this method is false for development and true for production.
|
||||
///
|
||||
/// @param devicetoken used to generate PushID.
|
||||
/// @param isProduct Used to determine whether the current environment is a development or production environment.
|
||||
- (void)setDeviceToken:(NSData *)devicetoken isProduct:(BOOL)isProduct;
|
||||
|
||||
- (void)setVoipToken:(NSData *)voipToken isProduct:(BOOL)isProduct;
|
||||
/// Available since: 2.0.0 and above.
|
||||
///
|
||||
/// Description: Set event notification callback, pass [null] to clear the set callback.
|
||||
///
|
||||
/// When to call /Trigger: Need to receive the ZPNsNotificationCenterDelegate method, this method is called to set the agent.
|
||||
///
|
||||
/// Caution: If the developer calls this function more than once, the callback set by the last time the function was called will be overridden.
|
||||
- (void)setZPNsNotificationCenterDelegate:(id<ZPNsNotificationCenterDelegate>)delegate;
|
||||
|
||||
- (void)addLocalNotificationRequest:(UNNotificationRequest *)request
|
||||
withCompletionHandler:(nullable void (^)(NSError *__nullable error))completionHandler
|
||||
API_AVAILABLE(macos(10.14), ios(10.0));
|
||||
|
||||
- (void)addLocalNotificationWithContent:(UNMutableNotificationContent *)content
|
||||
trigger:(UNTimeIntervalNotificationTrigger *)trigger
|
||||
withCompletionHandler:
|
||||
(nullable void (^)(NSError *__nullable error))completionHandler
|
||||
API_AVAILABLE(macos(10.14), ios(10.0))
|
||||
DEPRECATED_MSG_ATTRIBUTE("Deprecated since ZPNs 2.4.0, please use another "
|
||||
"[addLocalNotificationRequest] instead");
|
||||
|
||||
/// Available since:ZPNs version 2.6.0 or later.
|
||||
///
|
||||
/// Description:Reports the number of badge of the current App to the ZPNs server through this interface. When the app is offline, the ZPNs changes based on the previously reported badge mark number.
|
||||
///
|
||||
/// Use cases: When the local badge of the developer is changed, this interface is called to report the change.
|
||||
///
|
||||
/// Default value:If the receiver does not report the badge, the badge mark will not be modified when the push is sent.
|
||||
///
|
||||
/// When to call /Trigger:It can be called at any time, but the actual time reported to the background is after pushID has successfully registered and the user has logged in, and before logging out.
|
||||
///
|
||||
/// Restrictions: There is no single interface frequency limit.
|
||||
///
|
||||
/// Caution:badge cannot be less than 0.
|
||||
- (void)setBadge:(int)badge;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
BIN
Libs/ZPNs.framework/Info.plist
Normal file
BIN
Libs/ZPNs.framework/Info.plist
Normal file
Binary file not shown.
6
Libs/ZPNs.framework/Modules/module.modulemap
Normal file
6
Libs/ZPNs.framework/Modules/module.modulemap
Normal file
@@ -0,0 +1,6 @@
|
||||
framework module ZPNs {
|
||||
umbrella header "ZPNs.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
BIN
Libs/ZPNs.framework/ZPNs
Executable file
BIN
Libs/ZPNs.framework/ZPNs
Executable file
Binary file not shown.
Reference in New Issue
Block a user