You need to send the following information to RMC for APNS communication:
...
Code Block | ||
---|---|---|
| ||
EuroManager.sharedManager("AppcentIOSTest1").synchronize()
|
IYS Email Register
If your user is a corporate account, you must send it as a TACIR. For this, change the isCommercial parameter to true from the registerEmail method.
Objective-C
Code Block | ||
---|---|---|
| ||
void (^success)(void) = ^void(void) {
NSLog(@"registerEmail sucess");
};
void (^failure)(NSString*) = ^void(NSString* message) {
NSLog(@"registerEmail failure");
NSLog(@"%@", message);
};
[[EuroManager sharedManager:@"EuromsgIOSTest"] registerEmail:@"test@euromsg.com" emailPermit:YES isCommercial:NO success:success failure:failure]; |
Swift
Code Block | ||
---|---|---|
| ||
let success: (() -> Void)? = {
print("registerEmail sucess")
}
let failure: ((String?) -> Void)? = { message in
print("registerEmail failure")
print("\(message ?? "")")
}
EuroManager.sharedManager("EuromsgTest")?.registerEmail("test@euromsg.com", emailPermit: true, isCommercial: false, success: success, failure: failure) |
If a push notification arrives, application:didReceiveRemoteNotification method is invoked. The incoming message content should be given to the handlePush method in the EuroManager instance. This should be used for sending push open information.
...
File > New > Target > Select Notification Service Extension.
Enter the product name as Euro-IOSNotificationServiceExtension.
Select the language you use and press the Finish button.
Click the Cancel button in the dialog window that will open.
In the project navigator, select the top-level project directory and select the Euro-IOSNotificationServiceExtension target in the project and targets list. Unless you have a specific reason not to, you should set the Deployment Target to be iOS 11.
Open NotificationService.swift/NotificationService.m and replace the whole file's contents with the following code.
Swift
Code Block | ||
---|---|---|
| ||
import UserNotifications import Euro_IOS class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) EuroManager.didReceive(bestAttemptContent, withContentHandler: contentHandler) } override func serviceExtensionTimeWillExpire() { // Called just before the extension will be terminated by the system. // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { EuroManager.didReceive(bestAttemptContent, withContentHandler: contentHandler) } } } |
...