react-native-mapp-plugin 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/Mapp-Engage-ReactNative-Plugin.iml +9 -0
- package/.idea/caches/deviceStreaming.xml +787 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/CHANGELOG.md +21 -0
- package/Mapp.js +36 -7
- package/RNMappPlugin.podspec +2 -2
- package/android/.settings/org.eclipse.buildship.core.prefs +1 -1
- package/android/build.gradle +10 -10
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/settings.gradle +3 -3
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/java/com/reactlibrary/RNMappPluginModule.java +68 -1
- package/build/generated/ios/MappEngagePluginSpec/MappEngagePluginSpec-generated.mm +16 -0
- package/build/generated/ios/MappEngagePluginSpec/MappEngagePluginSpec.h +38 -0
- package/build/generated/ios/MappEngagePluginSpecJSI-generated.cpp +17 -0
- package/build/generated/ios/MappEngagePluginSpecJSI.h +19 -0
- package/build/generated/ios/RCTAppDependencyProvider.h +25 -0
- package/build/generated/ios/RCTAppDependencyProvider.mm +35 -0
- package/build/generated/ios/RCTModuleProviders.h +16 -0
- package/build/generated/ios/RCTModuleProviders.mm +51 -0
- package/build/generated/ios/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/build/generated/ios/RCTModulesConformingToProtocolsProvider.mm +54 -0
- package/build/generated/ios/RCTThirdPartyComponentsProvider.h +16 -0
- package/build/generated/ios/RCTThirdPartyComponentsProvider.mm +30 -0
- package/build/generated/ios/ReactAppDependencyProvider.podspec +34 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/Info.plist +48 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/ios-arm64/libAppoxeeLocationServices.a +0 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/ios-arm64_x86_64-simulator/Headers/AppoxeeLocationManager.h +122 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/ios-arm64_x86_64-simulator/Headers/AppoxeeLocationServices.h +11 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/ios-arm64_x86_64-simulator/libAppoxeeLocationServices.a +0 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/Info.plist +48 -0
- package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXClientDevice.h +1 -0
- package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXPushNotificationActionButtonAction.h +3 -2
- package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/Appoxee.h +39 -2
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64/libAppoxeeSDK.a +0 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXClientDevice.h +27 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXInterfaceService.h +49 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXPushNotification.h +92 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXPushNotificationAction.h +20 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXPushNotificationActionButton.h +19 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXPushNotificationActionButtonAction.h +36 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXRichMessage.h +58 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/Appoxee.h +877 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/AppoxeeManager.h +386 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/AppoxeeSDK.h +12 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/libAppoxeeSDK.a +0 -0
- package/ios/RNMappPluginModule.m +25 -0
- package/package.json +7 -7
- package/ios/Frameworks/AppoxeeLocationServices.framework/Versions/A/AppoxeeLocationServices +0 -0
- package/ios/Frameworks/AppoxeeSDK.framework/Versions/A/AppoxeeSDK +0 -0
- /package/ios/Frameworks/{AppoxeeLocationServices.framework/Versions/A → AppoxeeLocationServices.xcframework/ios-arm64}/Headers/AppoxeeLocationManager.h +0 -0
- /package/ios/Frameworks/{AppoxeeLocationServices.framework/Versions/A → AppoxeeLocationServices.xcframework/ios-arm64}/Headers/AppoxeeLocationServices.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXInterfaceService.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXPushNotification.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXPushNotificationAction.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXPushNotificationActionButton.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXRichMessage.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/AppoxeeManager.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/AppoxeeSDK.h +0 -0
|
@@ -0,0 +1,877 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Appoxee.h
|
|
3
|
+
// AppoxeeSDK
|
|
4
|
+
//
|
|
5
|
+
// Created by Raz Elkayam on 16/12/2015.
|
|
6
|
+
// Copyright © 2015 Appoxee. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import <UIKit/UIKit.h>
|
|
11
|
+
#import "APXPushNotification.h"
|
|
12
|
+
#import "APXRichMessage.h"
|
|
13
|
+
#import "APXClientDevice.h"
|
|
14
|
+
#import <UserNotifications/UserNotifications.h>
|
|
15
|
+
|
|
16
|
+
typedef NS_ENUM(NSInteger, SERVER) {
|
|
17
|
+
L3,
|
|
18
|
+
EMC,
|
|
19
|
+
EMC_US,
|
|
20
|
+
CROC,
|
|
21
|
+
TEST,
|
|
22
|
+
TEST55,
|
|
23
|
+
TEST61
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
@class Appoxee;
|
|
27
|
+
@class UNUserNotificationCenter;
|
|
28
|
+
@class UNNotificationResponse;
|
|
29
|
+
|
|
30
|
+
typedef void(^AppoxeeCompletionHandler)(NSError * _Nullable appoxeeError, id _Nullable data);
|
|
31
|
+
|
|
32
|
+
@protocol AppoxeeNotificationDelegate <NSObject>
|
|
33
|
+
|
|
34
|
+
@optional
|
|
35
|
+
/**
|
|
36
|
+
Delegate method for informing Push Notification handling by Appoxee SDK.
|
|
37
|
+
@brief Method is called when a Push Notification is handled by Appoxee SDK.
|
|
38
|
+
@param appoxee A singleton instance of Appoxee.
|
|
39
|
+
@param pushNotification An instance of APXPushNotification object which represents a Push Notification object.
|
|
40
|
+
@param actionIdentifier An optional identifier, if the Push Notification has an ‘action’ associated with it, else value is nil.
|
|
41
|
+
*/
|
|
42
|
+
- (void)appoxee:(nonnull Appoxee *)appoxee handledRemoteNotification:(nonnull APXPushNotification *)pushNotification andIdentifer:(nonnull NSString *)actionIdentifier;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
Delegate method for informing Rich Content handling by Appoxee SDK and was delivered with a Push Notification.
|
|
46
|
+
@brief Method iscalled when Rich Content is handled by Appoxee SDK and is delivered with a Push Notification. @attention The developer should decide how to display the Rich Message content.
|
|
47
|
+
@attention The developer should decide how to display the Rich Message content.
|
|
48
|
+
@param appoxee A singleton instance of Appoxee.
|
|
49
|
+
@param richMessage An instance of APXRichMessage object which represents Rich Content object.
|
|
50
|
+
@param didLaunch A Boolean value indicating if the Rich Content was recieved while app was launched, due to a Push Notification.
|
|
51
|
+
*/
|
|
52
|
+
- (void)appoxee:(nonnull Appoxee *)appoxee handledRichContent:(nonnull APXRichMessage *)richMessage didLaunchApp:(BOOL)didLaunch;
|
|
53
|
+
|
|
54
|
+
@end
|
|
55
|
+
|
|
56
|
+
@interface Appoxee : NSObject
|
|
57
|
+
|
|
58
|
+
/*!
|
|
59
|
+
* Between 1 - 5, where 1 prints all logs and 5 prints critical logs.
|
|
60
|
+
*/
|
|
61
|
+
@property (nonatomic) NSInteger logLevel;
|
|
62
|
+
|
|
63
|
+
/*!
|
|
64
|
+
* Set to YES to postpone a request for notifications.
|
|
65
|
+
* Setting the property should be performed prior to engaging the SDK.
|
|
66
|
+
*/
|
|
67
|
+
@property (nonatomic) BOOL postponeNotificationRequest;
|
|
68
|
+
|
|
69
|
+
/*!
|
|
70
|
+
* Indicates if Appoxee should show notifications when application is in foreground, on iOS10 and above.
|
|
71
|
+
* Set this property when ever needed, to change this behavior.
|
|
72
|
+
* Default value is NO.
|
|
73
|
+
*/
|
|
74
|
+
@property (nonatomic, readwrite) BOOL showNotificationsOnForeground;
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/*!
|
|
78
|
+
* Indicates if the device is registered at Appoxee (but not yet ready for push notifications). You can listen to ‘APX_Ready’ NSNotification to catch this event, or use KVO to get notified when state turns to YES.
|
|
79
|
+
*/
|
|
80
|
+
@property (nonatomic, readonly) BOOL isReady;
|
|
81
|
+
|
|
82
|
+
@property (nonatomic, readwrite) SERVER server;
|
|
83
|
+
|
|
84
|
+
/*!
|
|
85
|
+
* The Appoxee notification delegate.
|
|
86
|
+
*/
|
|
87
|
+
@property (nonatomic, weak, nullable) id <AppoxeeNotificationDelegate> delegate;
|
|
88
|
+
|
|
89
|
+
/*!
|
|
90
|
+
* The user's DMC user ID.
|
|
91
|
+
*/
|
|
92
|
+
@property (nonatomic, strong, nullable, readonly) NSString *dmcUserID;
|
|
93
|
+
|
|
94
|
+
/*!
|
|
95
|
+
* The DMC alias.
|
|
96
|
+
*/
|
|
97
|
+
@property (nonatomic, strong, nullable, readonly) NSString *dmcAlias;
|
|
98
|
+
|
|
99
|
+
@property (nonatomic, readwrite, nullable, strong) NSString *request;
|
|
100
|
+
@property (nonatomic, readwrite, nullable, strong) NSString *getAliasRequest;
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/*!
|
|
104
|
+
* The tennant id of app.
|
|
105
|
+
*/
|
|
106
|
+
@property (nonatomic, strong, nullable, readwrite) NSString *tennantID;
|
|
107
|
+
|
|
108
|
+
#pragma mark - Appoxee Push Service
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
Appoxee instance
|
|
112
|
+
@brief Method for gets a singleton instance of Appoxee.
|
|
113
|
+
<pre><code>
|
|
114
|
+
Appoxee *appoxee = [Appoxee shared];
|
|
115
|
+
</code></pre>
|
|
116
|
+
@return Appoxee an Instance Type of Appoxee.
|
|
117
|
+
*/
|
|
118
|
+
+ (nullable instancetype)shared;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
Appoxee SDK version string.
|
|
122
|
+
@brief Method to get the Appoxee SDK version string.
|
|
123
|
+
<pre><code>
|
|
124
|
+
NSString *sdkVersoin = [Appoxee sdkVersion];
|
|
125
|
+
</code></pre>
|
|
126
|
+
@return An NSString Object that represents an Appoxee SDK version.
|
|
127
|
+
*/
|
|
128
|
+
+ (nonnull NSString *)sdkVersion;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
@brief
|
|
132
|
+
Defines behavior of the Apple alert dialog for registring app for remote push notification
|
|
133
|
+
|
|
134
|
+
@return default value is true what means that alert dialog appear on first run of app, false allow developer to define moment when this dialog will appear.
|
|
135
|
+
*/
|
|
136
|
+
@property (nonatomic) BOOL isDefaultBehaviorOfNotificationRegistration;
|
|
137
|
+
|
|
138
|
+
+(SERVER) getServer;
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
+(nullable NSString *) getRequest;
|
|
142
|
+
|
|
143
|
+
+(nullable NSString *) getAliasRequest;
|
|
144
|
+
/**
|
|
145
|
+
Method auto integrate and engage with Appoxee SDK.
|
|
146
|
+
@brief Call this method to perform auto integration of your AppDelegate file, and to engage with Appoxee SDK.
|
|
147
|
+
@attention Provide an AppoxeeConfiguration.plist in your application. Method is considered critical, and must be implemented.
|
|
148
|
+
<pre><code>
|
|
149
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
150
|
+
{
|
|
151
|
+
// Method takes into consideration a valid AppoxeeConfig.plist file in your application.
|
|
152
|
+
[[Appoxee shared] engageAndAutoIntegrateWithLaunchOptions:launchOptions andDelegate:nil];
|
|
153
|
+
return YES;
|
|
154
|
+
}
|
|
155
|
+
</code></pre>
|
|
156
|
+
@param launchOptions NSDictionary which contains the launchOptions of didFinishLaunchingWithOptions AppDelegate method.
|
|
157
|
+
@param delegate An object which conforms to AppoxeeDelegate Protocol.
|
|
158
|
+
@param willAppear Flag which define behavior of notification registration alert dialog.
|
|
159
|
+
*/
|
|
160
|
+
- (void)engageAndAutoIntegrateWithLaunchOptions:(nullable NSDictionary *)launchOptions andDelegate:(nullable id<AppoxeeNotificationDelegate>)delegate notificationDiaog:(BOOL)willAppear with:(SERVER)server;
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
Method auto integrate and engage with Appoxee SDK.
|
|
165
|
+
@brief Call this method to perform auto integration of your AppDelegate file, and to engage with Appoxee SDK.
|
|
166
|
+
@attention Provide an AppoxeeConfiguration.plist in your application. Method is considered critical, and must be implemented.
|
|
167
|
+
<pre><code>
|
|
168
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
169
|
+
{
|
|
170
|
+
// Method takes into consideration a valid AppoxeeConfig.plist file in your application.
|
|
171
|
+
[[Appoxee shared] engageAndAutoIntegrateWithLaunchOptions:launchOptions andDelegate:nil];
|
|
172
|
+
return YES;
|
|
173
|
+
}
|
|
174
|
+
</code></pre>
|
|
175
|
+
@param launchOptions NSDictionary which contains the launchOptions of didFinishLaunchingWithOptions AppDelegate method.
|
|
176
|
+
@param delegate An object which conforms to AppoxeeDelegate Protocol.
|
|
177
|
+
*/
|
|
178
|
+
- (void)engageAndAutoIntegrateWithLaunchOptions:(nullable NSDictionary *)launchOptions andDelegate:(nullable id<AppoxeeNotificationDelegate>)delegate with:(SERVER)server;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
Method for engaging Appoxee SDK.
|
|
182
|
+
@brief Call this method to engage Appoxee SDK in your application.
|
|
183
|
+
@attention Method is considered critical, and must be implemented.
|
|
184
|
+
<pre><code>
|
|
185
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
186
|
+
{
|
|
187
|
+
[[Appoxee shared] engageWithLaunchOptions:launchOptions andDelegate:self andSDKID:@"123"];
|
|
188
|
+
return YES;
|
|
189
|
+
}
|
|
190
|
+
</code></pre>
|
|
191
|
+
@param launchOptions NSDictionary which contains the launchOptions of didFinishLaunchingWithOptions AppDelegate method.
|
|
192
|
+
@param delegate An object which conforms to AppoxeeDelegate Protocol.
|
|
193
|
+
@param sdkID NSString representation of the SDK ID.
|
|
194
|
+
*/
|
|
195
|
+
- (void)engageWithLaunchOptions:(nullable NSDictionary *)launchOptions andDelegate:(nullable id<AppoxeeNotificationDelegate>)delegate andSDKID:(nonnull NSString *)sdkID with:(SERVER)server;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
Method for save userNotificationCategories to Appoxee SDK..
|
|
199
|
+
@brief Call this method to save userNotificationCategories to Appoxee SDK.
|
|
200
|
+
<pre><code>
|
|
201
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
202
|
+
{
|
|
203
|
+
Appoxee.shared()?.saveUserNotificationCategory([NSArray])
|
|
204
|
+
}
|
|
205
|
+
</code></pre>
|
|
206
|
+
*/
|
|
207
|
+
- (void)saveUserNotificationCategories:(NSArray<UNNotificationCategory*> *_Nonnull) userCategories;
|
|
208
|
+
/**
|
|
209
|
+
Method for show register notificationa alert dialog into Appoxee SDK.
|
|
210
|
+
@brief call this method when you want to show notification registration alert dialog.
|
|
211
|
+
@attention Method is considered critical, and must be implemented.
|
|
212
|
+
<pre><code>
|
|
213
|
+
[[Appoxe shared] showNotificationAlertDialog];
|
|
214
|
+
</pre></code>
|
|
215
|
+
*/
|
|
216
|
+
- (void)showNotificationAlertDialog;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
Method for notifing Appoxee registration for Push Notifications was succesful.
|
|
220
|
+
@brief Notify Appoxee on a successful registration of APNS.
|
|
221
|
+
@attention method is considered critical and must be implemented. If engageAndAutoIntegrateWithLaunchOptions:andDelegate:andSDKID or engageAndAutoIntegrateWithLaunchOptions:andDelegate: is used, implementation is optional.
|
|
222
|
+
<pre><code>
|
|
223
|
+
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
|
|
224
|
+
{
|
|
225
|
+
[[Appoxee shared] didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
|
|
226
|
+
}
|
|
227
|
+
</code></pre>
|
|
228
|
+
@param token NSData representation of Apple generated Push Token.
|
|
229
|
+
*/
|
|
230
|
+
- (void)didRegisterForRemoteNotificationsWithDeviceToken:(nullable NSData *)token;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
Method for notifing Appoxee on registration progress.
|
|
234
|
+
@brief Appoxee on registration progress.
|
|
235
|
+
@attention method is considered critical and must be implemented. If engageAndAutoIntegrateWithLaunchOptions:andDelegate:andSDKID: or engageAndAutoIntegrateWithLaunchOptions:andDelegate: is used, implementation is optional.
|
|
236
|
+
<pre><code>
|
|
237
|
+
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
|
|
238
|
+
{
|
|
239
|
+
[[Appoxee shared] didRegisterUserNotificationSettings:notificationSettings];
|
|
240
|
+
}
|
|
241
|
+
</code></pre>
|
|
242
|
+
@param notificationSettings UIUserNotificationSettings instance.
|
|
243
|
+
*/
|
|
244
|
+
- (void)didRegisterUserNotificationSettings:(nullable NSObject *)notificationSettings;
|
|
245
|
+
|
|
246
|
+
#pragma mark - Push Handling iOS9
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
Method for notifing Appoxee a remote Push Notification was received to the device.
|
|
250
|
+
@brief Use this method to pass information to Appoxee Manager regarding incoming push notifications.
|
|
251
|
+
@attention method is considered critical and must be implemented. If engageAndAutoIntegrateWithLaunchOptions:andDelegate:andSDKID: or engageAndAutoIntegrateWithLaunchOptions:andDelegate: is used, implementation is optional.
|
|
252
|
+
<pre><code>
|
|
253
|
+
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
|
|
254
|
+
{
|
|
255
|
+
[[Appoxee shared] receivedRemoteNotification:userInfo];
|
|
256
|
+
}
|
|
257
|
+
</code></pre>
|
|
258
|
+
@param userInfo NSDictionary object containing user info with Push payload.
|
|
259
|
+
*/
|
|
260
|
+
- (void)receivedRemoteNotification:(nullable NSDictionary *)userInfo;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
Method for handling 'Push Actions'. Forward this call to Appoxee directly and call completionHandler(); if the returned value is NO, since Appoxee will not handle a complete custom action provided by the developer.
|
|
264
|
+
@brief Implementation of this method enables ‘Push Actions’. Forward this call to Appoxee directly and call completionHandler(); if the returned value is NO, since Appoxee will not handle a complete custom action provided by the developer.
|
|
265
|
+
@attention If engageAndAutoIntegrateWithLaunchOptions:andDelegate:andSDKID: or engageAndAutoIntegrateWithLaunchOptions:andDelegate: is used, implementation is optional.
|
|
266
|
+
<pre><code>
|
|
267
|
+
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler
|
|
268
|
+
{
|
|
269
|
+
[[Appoxee shared] handleActionWithIdentifier:identifier forRemoteNotification:userInfo completionHandler:completionHandler];
|
|
270
|
+
}
|
|
271
|
+
</code></pre>
|
|
272
|
+
@param identifier The identifier argument passed by the application delegate.
|
|
273
|
+
@param userInfo The userInfo argument passed by the application delegate.
|
|
274
|
+
@param completionHandler The completionHandler argument passed by the application delegate.
|
|
275
|
+
@return YES, if Appoxee handled the action, else returns NO. If the returned value is NO, you will need to call completionHandler(); after you finish handling the Push action.
|
|
276
|
+
*/
|
|
277
|
+
- (BOOL)handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(nullable NSDictionary *)userInfo completionHandler:(nonnull void (^)())completionHandler;
|
|
278
|
+
|
|
279
|
+
/*
|
|
280
|
+
|
|
281
|
+
Application's plist must contain a 'remote-notification' value in 'UIBackgroundModes'.
|
|
282
|
+
|
|
283
|
+
*/
|
|
284
|
+
/**
|
|
285
|
+
Method for enabling Appoxee to fetch new data while in background. If completionHandler is nil, Appoxee assumes the developer also has work to perform, and by this Appoxee will NOT call the completionHandler, but it will provide a UIBackgroundFetchResult as an NSNumber argument in the AppoxeeCompletionHandler block. Application's plist must contain a 'remote-notification' value in 'UIBackgroundModes'.
|
|
286
|
+
@brief Implementation of this method enables Appoxee to fetch new data, or update a geo location, while in background. If completionHandler is nil, Appoxee assumes the developer also has work to perform, and by this Appoxee will NOT call the completionHandler, but it will provide a UIBackgroundFetchResult as an NSNumber argument in the AppoxeeCompletionHandler block. Application’s plist must contain a ‘remote-notification’ value in ‘UIBackgroundModes’.
|
|
287
|
+
@attention If engageAndAutoIntegrateWithLaunchOptions:andDelegate:andSDKID: or engageAndAutoIntegrateWithLaunchOptions:andDelegate: is used, implementation is optional.
|
|
288
|
+
<pre><code>
|
|
289
|
+
// 1.
|
|
290
|
+
// Handling a silent push which did not originate at Appoxee.
|
|
291
|
+
- (void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
|
292
|
+
{
|
|
293
|
+
// passing completionHandler for the completionHandler argument, so that Appoxee calls it when Appoxee is done.
|
|
294
|
+
[[Appoxee shared] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler andNotifyCompletionWithBlock:^(NSError * Nullable appoxeeError, id Nullable data) {
|
|
295
|
+
|
|
296
|
+
if (appoxeeError) {
|
|
297
|
+
|
|
298
|
+
// This means that the silent push did not originate from Appoxee. The data param will contain a UIBackgroundFetchResultFailed as an NSNumber.
|
|
299
|
+
// Appoxee will not perform any action, and it is the developer's responsibility to call the completionHandler();.
|
|
300
|
+
completionHandler(UIBackgroundFetchResultFailed); // provide an UIBackgroundFetchResult by your own app-specific logic.
|
|
301
|
+
|
|
302
|
+
} else {
|
|
303
|
+
|
|
304
|
+
// No need to pefrom any action, since Appoxee will call completionHandler() providing it a UIBackgroundFetchResult.
|
|
305
|
+
|
|
306
|
+
}
|
|
307
|
+
}];
|
|
308
|
+
}
|
|
309
|
+
// 2.
|
|
310
|
+
// Handling the completion handler by the developer
|
|
311
|
+
- (void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
|
312
|
+
{
|
|
313
|
+
// passing nil for the completionHandler argument, so that the developer can also perform it’s work.
|
|
314
|
+
[[Appoxee shared] didReceiveRemoteNotification:userInfo fetchCompletionHandler:nil andNotifyCompletionWithBlock:^(NSError * Nullable appoxeeError, id Nullable data) {
|
|
315
|
+
|
|
316
|
+
if (appoxeeError) {
|
|
317
|
+
|
|
318
|
+
// This means that the silent push did not originate from Appoxee. The data param will contain a UIBackgroundFetchResultFailed as an NSNumber.
|
|
319
|
+
// Appoxee will not perform any action, and it is the developer's responsibility to call the completionHandler();.
|
|
320
|
+
|
|
321
|
+
// add Developer operations logic, and call:
|
|
322
|
+
completionHandler(UIBackgroundFetchResultNewData); // provide an UIBackgroundFetchResult by your own app-specific logic.
|
|
323
|
+
|
|
324
|
+
} else {
|
|
325
|
+
|
|
326
|
+
// add Developer operations logic, and call:
|
|
327
|
+
completionHandler(UIBackgroundFetchResultNewData); // provide an UIBackgroundFetchResult by your own app-specific logic.
|
|
328
|
+
}
|
|
329
|
+
}];
|
|
330
|
+
}
|
|
331
|
+
</code></pre>
|
|
332
|
+
@param userInfo NSDictionary object containing user info with Push payload.
|
|
333
|
+
@param completionHandler The OS completion handler block. Must be called (by Appoxee / by developer) when work is completed. if param is nil, the developer will need to call it on he's own. If provided, Appoxee will call it when it completes its work, unless the silent-push did not originate at Appoxee. It is advised to wait for the completionBlock parameters, and act according to their data.
|
|
334
|
+
@param completionBlock A completion block which will be called when Appoxee completes it's work, enabling the developer to call completionHandler, in case fetchHandler is nil.
|
|
335
|
+
*/
|
|
336
|
+
- (void)didReceiveRemoteNotification:(nullable NSDictionary *)userInfo fetchCompletionHandler:(nullable void (^)(UIBackgroundFetchResult))completionHandler andNotifyCompletionWithBlock:(nullable AppoxeeCompletionHandler)completionBlock;
|
|
337
|
+
|
|
338
|
+
#pragma mark - Background fetch
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
Method for enabling Appoxee to fetch new data while in background. If fetchHandler is nil, Appoxee assumes the developer also has work to perform, and by this Appoxee will NOT call the fetchHandler, but it will provide a UIBackgroundFetchResult as an NSNumber argument in the AppoxeeCompletionHandler block. Application's plist must contain a 'fetch' value in 'UIBackgroundModes'.
|
|
342
|
+
@brief Implementation of this method enables Appoxee to fetch new data, or update a geo location, while in background. If fetchHandler is nil, Appoxee assumes the developer also has work to perform, and by this Appoxee will NOT call the fetchHandler, but it will provide a UIBackgroundFetchResult as an NSNumber argument in the AppoxeeCompletionHandler block. Application’s plist must contain a ‘fetch’ value in ‘UIBackgroundModes’.
|
|
343
|
+
@attention If engageAndAutoIntegrateWithLaunchOptions:andDelegate:andSDKID: or engageAndAutoIntegrateWithLaunchOptions:andDelegate: is used, implementation is optional.
|
|
344
|
+
<pre><code>
|
|
345
|
+
// 1.
|
|
346
|
+
// In case the developer needs to perform work.
|
|
347
|
+
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
|
348
|
+
{
|
|
349
|
+
|
|
350
|
+
[[Appoxee shared] performFetchWithCompletionHandler:nil andNotifyCompletionWithBlock:^(NSError * Nullable appoxeeError, id Nullable data) {
|
|
351
|
+
|
|
352
|
+
if ([data isKindOfClass:[NSNumber class]]) {
|
|
353
|
+
|
|
354
|
+
// Fetch the background resualt provided by Appoxee, notifying if Appoxee did fetch new data, or did not.
|
|
355
|
+
NSNumber *backgroundFetchResult = (NSNumber *)data;
|
|
356
|
+
|
|
357
|
+
// Call the completion handler, when you finish your work.
|
|
358
|
+
completionHandler([backgroundFetchResult integerValue]);
|
|
359
|
+
}
|
|
360
|
+
}];
|
|
361
|
+
}
|
|
362
|
+
// 2.
|
|
363
|
+
// In case the developer does not need to perform work.
|
|
364
|
+
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
|
365
|
+
{
|
|
366
|
+
// Appoxee will call completionHandler(); with a UIBackgroundFetchResult when it will finish it’s work.
|
|
367
|
+
[[Appoxee shared] performFetchWithCompletionHandler:completionHandler andNotifyCompletionWithBlock:nil];
|
|
368
|
+
}
|
|
369
|
+
</code></pre>
|
|
370
|
+
@param fetchHandler The OS fetch handler block. must be called (by Appoxee / by developer) when work is completed. if nil, the developer will need to call it, while waiting for Appoxee's completionBlock. If provided, then Appoxee will call the fetchHandler when done.
|
|
371
|
+
@param completionBlock A completion block which will be called when Appoxee completes it's work, enabling the developer to be notified, in case fetchHandler is nil, and to call the fetchHandler.
|
|
372
|
+
*/
|
|
373
|
+
- (void)performFetchWithCompletionHandler:(nullable void (^)(UIBackgroundFetchResult))fetchHandler andNotifyCompletionWithBlock:(nullable AppoxeeCompletionHandler)completionBlock;
|
|
374
|
+
|
|
375
|
+
#pragma mark - Push Handling ios10
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
Forward UNNotificationResponse to Appoxee. If Implementing UNUserNotificationCenterDelegate on your own, call this method to forward notifications to Appoxee, thus keeping analytics data, or any other push oriented operations going.
|
|
379
|
+
@brief Forward UNNotificationResponse to Appoxee.
|
|
380
|
+
@attention Method is required only if you intend to act as the UNUserNotificationCenterDelegate.
|
|
381
|
+
<pre><code>
|
|
382
|
+
#pragma mark - UNUserNotificationCenterDelegate
|
|
383
|
+
|
|
384
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler
|
|
385
|
+
{
|
|
386
|
+
[[Appoxee shared] userNotificationCenter:center didReceiveNotificationResponse:response withAppoxeeCompletionHandler:^{
|
|
387
|
+
|
|
388
|
+
// Appoxee completed it's work.
|
|
389
|
+
completionHandler();
|
|
390
|
+
}];
|
|
391
|
+
}
|
|
392
|
+
</code></pre>
|
|
393
|
+
@param center The notification center that received the notification.
|
|
394
|
+
@param response The user’s response to the notification. This object contains the original notification and the identifier string for the selected action. If the action allowed the user to provide a textual response, this object is an instance of the UNTextInputNotificationResponse class.
|
|
395
|
+
@param appoxeeCompletionHandler The block to execute when Appoxee finished processing the notification. The block has no return value or parameters.
|
|
396
|
+
*/
|
|
397
|
+
- (void)userNotificationCenter:(nonnull UNUserNotificationCenter *)center didReceiveNotificationResponse:(nonnull UNNotificationResponse *)response withAppoxeeCompletionHandler:(nullable void (^)())appoxeeCompletionHandler __IOS_AVAILABLE(10.0);
|
|
398
|
+
|
|
399
|
+
#pragma mark - Device API
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
Disable and re-enable Push Notifications.
|
|
403
|
+
@brief Method will disable or re-enable Push Notification per device at Appoxee Dashboard.
|
|
404
|
+
@attention Method does not un-register from push notifications, but rather, it opts-out the device from Push Services at Appoxee Dashboard.
|
|
405
|
+
<pre><code>
|
|
406
|
+
[[Appoxee shared] disablePushNotifications:booleanArgument withCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
407
|
+
|
|
408
|
+
if (!appoxeeError) {
|
|
409
|
+
|
|
410
|
+
// operation was successful.
|
|
411
|
+
}
|
|
412
|
+
}];
|
|
413
|
+
</code></pre>
|
|
414
|
+
@param isDisabled BOOL value indacating if should enable or disable push.
|
|
415
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
416
|
+
*/
|
|
417
|
+
- (void)disablePushNotifications:(BOOL)isDisabled withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
Get the current state of the push from Appoxee dashboard.
|
|
421
|
+
@brief Method to get the state value of the push status from Appoxee Dashboard.
|
|
422
|
+
@attention Method indicates if a device is push-enabled at Appoxee dashboard, and not if a device is registered for APNS.
|
|
423
|
+
<pre><code>
|
|
424
|
+
[[Appoxee shared] isPushEnabled:^(NSError *appoxeeError, id data) {
|
|
425
|
+
|
|
426
|
+
if (!appoxeeError) {
|
|
427
|
+
|
|
428
|
+
BOOL state = [(NSNumber *)data boolValue];
|
|
429
|
+
}
|
|
430
|
+
}];
|
|
431
|
+
</code></pre>
|
|
432
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
433
|
+
*/
|
|
434
|
+
- (void)isPushEnabled:(nullable AppoxeeCompletionHandler)handler;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
Standalone Feature
|
|
438
|
+
Disable and re-enable Inbox.
|
|
439
|
+
@brief Method disables or re-enables Inbox.
|
|
440
|
+
@attention Standalone Feature. Method does not un-register sound from push notifications, but opts-out the device sound from Push Services at Appoxee dashboard.
|
|
441
|
+
<pre><code>
|
|
442
|
+
[[Appoxee shared] disableInbox:booleanArgument completionHwithCompletionHandlerandler:^(NSError *appoxeeError, id data) {
|
|
443
|
+
|
|
444
|
+
if (!appoxeeError) {
|
|
445
|
+
|
|
446
|
+
// operation was successful.
|
|
447
|
+
}
|
|
448
|
+
}];
|
|
449
|
+
</code></pre>
|
|
450
|
+
@param isDisabled BOOL value indacating if should enable or disable sound.
|
|
451
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
452
|
+
*/
|
|
453
|
+
- (void)disableInbox:(BOOL)isDisabled withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
Standalone Feature
|
|
457
|
+
Get the current state of the Inbox.
|
|
458
|
+
@brief Method to get the current state of Inbox.
|
|
459
|
+
@attention Standalone Feature. Method fetches opt-out status of the device inbox from Push Services at Appoxee dashboard.
|
|
460
|
+
<pre><code>
|
|
461
|
+
[[Appoxee shared] isInboxEnabled:^(NSError *appoxeeError, id data) {
|
|
462
|
+
|
|
463
|
+
if (!appoxeeError) {
|
|
464
|
+
|
|
465
|
+
BOOL state = [(NSNumber *)data boolValue];
|
|
466
|
+
}
|
|
467
|
+
}];
|
|
468
|
+
</code></pre>
|
|
469
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
470
|
+
*/
|
|
471
|
+
- (void)isInboxEnabled:(nullable AppoxeeCompletionHandler)handler;
|
|
472
|
+
|
|
473
|
+
-(void)logoutWithOptin: (BOOL)status;
|
|
474
|
+
|
|
475
|
+
#pragma mark - Alias
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
Set an alias to be identifies with a device.
|
|
479
|
+
@brief Method sets an alias to identify a device.
|
|
480
|
+
<pre><code>
|
|
481
|
+
[[Appoxee shared] setDeviceAlias:@"Alias" withCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
482
|
+
|
|
483
|
+
if (!appoxeeError) {
|
|
484
|
+
|
|
485
|
+
// Alias was set.
|
|
486
|
+
}
|
|
487
|
+
}];
|
|
488
|
+
</code></pre>
|
|
489
|
+
@param alias An NSString object representing an alias.
|
|
490
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
491
|
+
*/
|
|
492
|
+
- (void)setDeviceAlias:(nullable NSString *)alias withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
493
|
+
/**
|
|
494
|
+
Set an alias to be identifies with a device.
|
|
495
|
+
@brief Method sets an alias to identify a device.
|
|
496
|
+
<pre><code>
|
|
497
|
+
[[Appoxee shared] setDeviceAlias:@"Alias" withCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
498
|
+
|
|
499
|
+
if (!appoxeeError) {
|
|
500
|
+
|
|
501
|
+
// Alias was set.
|
|
502
|
+
}
|
|
503
|
+
}];
|
|
504
|
+
</code></pre>
|
|
505
|
+
@param alias An NSString object representing an alias.
|
|
506
|
+
@param resendAttributes A BOOL value indicating if attributes should be resent to the server.
|
|
507
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
508
|
+
*/
|
|
509
|
+
- (void)setDeviceAlias:(nullable NSString *)alias withResendAttributes: (BOOL) resendAttributes withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
Remove an alias from a device.
|
|
513
|
+
@brief Method removes an alias from a device.
|
|
514
|
+
<pre><code>
|
|
515
|
+
[[Appoxee shared] removeDeviceAliasWithCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
516
|
+
|
|
517
|
+
if (!appoxeeError) {
|
|
518
|
+
|
|
519
|
+
// Alias was removed.
|
|
520
|
+
}
|
|
521
|
+
}];
|
|
522
|
+
</code></pre>
|
|
523
|
+
An NSString object representing an alias.
|
|
524
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
525
|
+
*/
|
|
526
|
+
- (void)removeDeviceAliasWithCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
Get an alias for a device.
|
|
530
|
+
@brief Method gets the alias for a device.
|
|
531
|
+
<pre><code>
|
|
532
|
+
[[Appoxee shared] getDeviceAliasWithCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
533
|
+
|
|
534
|
+
if (!appoxeeError && [data isKindOfClass:[NSString class]]) {
|
|
535
|
+
|
|
536
|
+
NSString *deviceAlias = (NSString *)data;
|
|
537
|
+
}
|
|
538
|
+
}];
|
|
539
|
+
</code></pre>
|
|
540
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
541
|
+
*/
|
|
542
|
+
- (void)getDeviceAliasWithCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
Clear cached value of an alias.
|
|
546
|
+
@brief Method clears cached value of an alias.
|
|
547
|
+
<pre><code>
|
|
548
|
+
[[Appoxee shared] clearAliasCacheWithCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
549
|
+
|
|
550
|
+
if (!appoxeeError) {
|
|
551
|
+
|
|
552
|
+
// Alias cache was cleared.
|
|
553
|
+
}
|
|
554
|
+
}];
|
|
555
|
+
</code></pre>
|
|
556
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
557
|
+
*/
|
|
558
|
+
- (void)clearAliasCacheWithCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
559
|
+
|
|
560
|
+
#pragma mark - Device Tags
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
Standalone Feature
|
|
564
|
+
Get the device tags from Appoxee's servers
|
|
565
|
+
@brief Method gets the device tags from the Appoxee servers.
|
|
566
|
+
@attention Standalone Feature.
|
|
567
|
+
<pre><code>
|
|
568
|
+
[[Appoxee shared] fetchDeviceTags:^(NSError *appoxeeError, id data) {
|
|
569
|
+
|
|
570
|
+
if (!appoxeeError && [data isKindOfClass:[NSArray class]]) {
|
|
571
|
+
|
|
572
|
+
NSArray *deviceTags = (NSArray *)data;
|
|
573
|
+
}
|
|
574
|
+
}];
|
|
575
|
+
</code></pre>
|
|
576
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
577
|
+
*/
|
|
578
|
+
- (void)fetchDeviceTags:(nullable AppoxeeCompletionHandler)handler;
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
Standalone Feature
|
|
582
|
+
Get the application tags from Appoxee's servers
|
|
583
|
+
@brief Method gets the appilcation tags from the Appoxee servers.
|
|
584
|
+
@attention Standalone Feature.
|
|
585
|
+
<pre><code>
|
|
586
|
+
[[Appoxee shared] fetchApplicationTags:^(NSError *appoxeeError, id data) {
|
|
587
|
+
|
|
588
|
+
if (!appoxeeError && [data isKindOfClass:[NSArray class]]) {
|
|
589
|
+
|
|
590
|
+
NSArray *applicationTags = (NSArray *)data;
|
|
591
|
+
}
|
|
592
|
+
}];
|
|
593
|
+
</code></pre>
|
|
594
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
595
|
+
*/
|
|
596
|
+
- (void)fetchApplicationTags:(nullable AppoxeeCompletionHandler)handler;
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
Standalone Feature
|
|
600
|
+
Add Tags to a device.
|
|
601
|
+
@brief Method adds tags to a device. Method may return in the callback an error with APX_DataService domain value. This means that the operation was successfully completed, but with errors. The errors indicate if the operation triggered a server update. Operations such as adding an existing device tag, or passing an empty array, will trigger such APX_DataService errors. Any other error with a different domain indicates an unsuccessful operation.
|
|
602
|
+
@attention Standalone Feature.
|
|
603
|
+
<pre><code>
|
|
604
|
+
[[Appoxee shared] addTagsToDevice:@[@"firstTag", @"secondTag"] withCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
605
|
+
|
|
606
|
+
if (appoxeeError) {
|
|
607
|
+
|
|
608
|
+
// check the error domain
|
|
609
|
+
}
|
|
610
|
+
}];
|
|
611
|
+
</code></pre>
|
|
612
|
+
@param tagsToAdd NSArray containing a list of NSString tags.
|
|
613
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
614
|
+
*/
|
|
615
|
+
- (void)addTagsToDevice:(nullable NSArray <NSString *> *)tagsToAdd withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
Standalone Feature
|
|
619
|
+
Remove Tags from a device.
|
|
620
|
+
@brief Method removes tags from a device. Method may return in the callback an error with APX_DataService domain value. This means that the operation was successfully completed, but with errors. The errors indicate if the operation triggered a server update. Operations such as adding an existing device tag, or passing an empty array, will trigger such APX_DataService errors. Any other error with a different domain indicates an unsuccessful operation.
|
|
621
|
+
@attention Standalone Feature.
|
|
622
|
+
<pre><code>
|
|
623
|
+
[[Appoxee shared] removeTagsFromDevice:@[@"firstTag", @"secondTag"] withCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
624
|
+
|
|
625
|
+
if (appoxeeError) {
|
|
626
|
+
|
|
627
|
+
// check the error domain
|
|
628
|
+
}
|
|
629
|
+
}];
|
|
630
|
+
</code></pre>
|
|
631
|
+
@param tagsToRemove NSArray containing a list of NSString tags.
|
|
632
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
633
|
+
*/
|
|
634
|
+
- (void)removeTagsFromDevice:(nullable NSArray <NSString *> *)tagsToRemove withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
Standalone Feature
|
|
638
|
+
Add Tags to a device and remove tags from a device.
|
|
639
|
+
@brief Method adds tags to a device and removes tags from a device. Method may return in the callback an error with APX_DataService domain value. This means that the operation was successfully completed, but with errors. The errors indicate if the operation triggered a server update. Operations such as adding an existing device tag, or passing an empty array, will trigger such APX_DataService errors. Any other error with a different domain indicates an unsuccessful operation.
|
|
640
|
+
@attention Standalone Feature.
|
|
641
|
+
<pre><code>
|
|
642
|
+
[[Appoxee shared] addTagsToDevice:@[@"firstTag", @"secondTag"] andRemove:@[@"thirdTag", @"fourthTag"] withCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
643
|
+
|
|
644
|
+
if (appoxeeError) {
|
|
645
|
+
|
|
646
|
+
// check the error domain
|
|
647
|
+
}
|
|
648
|
+
}];
|
|
649
|
+
</code></pre>
|
|
650
|
+
@param tagsToAdd NSArray containing a list of NSString tags.
|
|
651
|
+
@param tagsToRemove NSArray containing a list of NSString tags.
|
|
652
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
653
|
+
*/
|
|
654
|
+
- (void)addTagsToDevice:(nullable NSArray <NSString *> *)tagsToAdd andRemove:(nullable NSArray <NSString *> *)tagsToRemove withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
Standalone Feature
|
|
658
|
+
Clear device tags cached on device.
|
|
659
|
+
@brief Method will clear the device tags cache.
|
|
660
|
+
@attention Standalone Feature.
|
|
661
|
+
<pre><code>
|
|
662
|
+
[[Appoxee shared] clearTagsCacheWithCompletionhandler:^(NSError *appoxeeError, id data) {
|
|
663
|
+
|
|
664
|
+
if (!appoxeeError) {
|
|
665
|
+
|
|
666
|
+
// operation is successful
|
|
667
|
+
}
|
|
668
|
+
}];
|
|
669
|
+
</code></pre>
|
|
670
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
671
|
+
*/
|
|
672
|
+
- (void)clearTagsCacheWithCompletionhandler:(nullable AppoxeeCompletionHandler)handler;
|
|
673
|
+
|
|
674
|
+
#pragma mark - Custom Fields
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
Set a custom date for a key to Appoxee Servers.
|
|
678
|
+
@brief Method sets a custom value of NDSate to Appoxee Servers.
|
|
679
|
+
<pre><code>
|
|
680
|
+
[[Appoxee shared] setDateValue:[NSDate date] forKey:@"key" withCompletionHandler:^(NSError * _Nullable appoxeeError, id _Nullable data) {
|
|
681
|
+
|
|
682
|
+
if (!appoxeeError) {
|
|
683
|
+
|
|
684
|
+
// Operation was successful.
|
|
685
|
+
}
|
|
686
|
+
}];
|
|
687
|
+
</code></pre>
|
|
688
|
+
@param date an NSDate instance representing a date.
|
|
689
|
+
@param key an NSString instance representing a key.
|
|
690
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
691
|
+
*/
|
|
692
|
+
- (void)setDateValue:(nonnull NSDate *)date forKey:(nonnull NSString *)key withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
693
|
+
|
|
694
|
+
/// Set custom attributes to Mapp Servers.
|
|
695
|
+
/// @param attributes NSDictionary with custom attributes.
|
|
696
|
+
/// @param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
697
|
+
- (void)setCustomAttributtes:(nonnull NSDictionary *)attributes withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
698
|
+
|
|
699
|
+
- (void)getCustomAttributes:(nonnull NSArray *)attributes withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
700
|
+
/**
|
|
701
|
+
Set a custom number for a key to Appoxee Servers.
|
|
702
|
+
@brief Method sets a custom value of NSNumber to Appoxee Servers.
|
|
703
|
+
<pre><code>
|
|
704
|
+
[[Appoxee shared] setNumberValue:@(1.01) forKey:@"key" withCompletionHandler:^(NSError * _Nullable appoxeeError, id _Nullable data) {
|
|
705
|
+
|
|
706
|
+
if (!appoxeeError) {
|
|
707
|
+
|
|
708
|
+
// Operation was successful.
|
|
709
|
+
}
|
|
710
|
+
}];
|
|
711
|
+
</code></pre>
|
|
712
|
+
@param number an NSNumber instance representing a number.
|
|
713
|
+
@param key an NSString instance representing a key.
|
|
714
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
715
|
+
*/
|
|
716
|
+
- (void)setNumberValue:(nonnull NSNumber *)number forKey:(nonnull NSString *)key withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
Increment a custom number for a key to Appoxee Servers.
|
|
720
|
+
@brief Method increments a custom value of NSNumber to Appoxee Servers. Value is added to an existing key, or else a new entry is created.
|
|
721
|
+
@attantion If key doesn't exist, a new key and value will be set.
|
|
722
|
+
<pre><code>
|
|
723
|
+
[[Appoxee shared] incrementNumericKey:@"key" byNumericValue:@(1.6) withCompletionHandler:^(NSError * _Nullable appoxeeError, id _Nullable data) {
|
|
724
|
+
|
|
725
|
+
if (!appoxeeError) {
|
|
726
|
+
|
|
727
|
+
// Operation was successful.
|
|
728
|
+
}
|
|
729
|
+
}];
|
|
730
|
+
</code></pre>
|
|
731
|
+
@param key an NSString instance representing a key.
|
|
732
|
+
@param number an NSNumber instance representing a number.
|
|
733
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
734
|
+
*/
|
|
735
|
+
- (void)incrementNumericKey:(nonnull NSString *)key byNumericValue:(nonnull NSNumber *)number withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
Set a custom string for a key to Appoxee Servers.
|
|
739
|
+
@brief Method sets a custom value of NSString to Appoxee Servers.
|
|
740
|
+
<pre><code>
|
|
741
|
+
[[Appoxee shared] setStringValue:@"string" forKey:@"key" withCompletionHandler:^(NSError * _Nullable appoxeeError, id _Nullable data) {
|
|
742
|
+
|
|
743
|
+
if (!appoxeeError) {
|
|
744
|
+
|
|
745
|
+
// Operation was successful.
|
|
746
|
+
}
|
|
747
|
+
}];
|
|
748
|
+
</code></pre>
|
|
749
|
+
@param string NSString instance representing a string.
|
|
750
|
+
@param key an NSString instance representing a key.
|
|
751
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
752
|
+
*/
|
|
753
|
+
- (void)setStringValue:(nonnull NSString *)string forKey:(nonnull NSString *)key withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
Get a key-value pair stored in cache.
|
|
757
|
+
@brief Method gets a key-value pair stored on the device.
|
|
758
|
+
<pre><code>
|
|
759
|
+
[[Appoxee shared] fetchCustomFieldByKey:@"CustomFieldKey" withCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
760
|
+
|
|
761
|
+
if (!appoxeeError && [data isKindOfClass:[NSDictionary class]]) {
|
|
762
|
+
|
|
763
|
+
NSDictionary *dictionary = (NSDictionary *)data;
|
|
764
|
+
NSString *key = [[dictionary allKeys] firstObject];
|
|
765
|
+
id value = dictionary[key]; // can be of the following types: NSString || NSNumber || NSDate
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// If there wan't an error, and data object is nil, then value doesn't exist on the device.
|
|
769
|
+
}];
|
|
770
|
+
</code></pre>
|
|
771
|
+
@param key NSString with the key of a previously saved key-value pair.
|
|
772
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
773
|
+
*/
|
|
774
|
+
- (void)fetchCustomFieldByKey:(nullable NSString *)key withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
Clear cached value of custom fields.
|
|
778
|
+
@brief Method clears cached value of custom fields.
|
|
779
|
+
<pre><code>
|
|
780
|
+
[[Appoxee shared] clearCustomFieldsCacheWithCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
781
|
+
|
|
782
|
+
if (!appoxeeError) {
|
|
783
|
+
|
|
784
|
+
// custom fields cache was cleared.
|
|
785
|
+
}
|
|
786
|
+
}];
|
|
787
|
+
</code></pre>
|
|
788
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
789
|
+
*/
|
|
790
|
+
- (void)clearCustomFieldsCacheWithCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
791
|
+
|
|
792
|
+
#pragma mark - Device Info
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
Get information on the current iDevice.
|
|
796
|
+
@brief Method gets information on the current iDevice.
|
|
797
|
+
<pre><code>
|
|
798
|
+
// Note that calling this method prior to device registration will provide basic information regarding this device.
|
|
799
|
+
// Developers should prefare using deviceInformationwithCompletionHandler:
|
|
800
|
+
APXClientDevice *device = [[Appoxee shared] deviceInfo];
|
|
801
|
+
</code></pre>
|
|
802
|
+
@return APXClientDevice an instance that describes this device.
|
|
803
|
+
*/
|
|
804
|
+
- (nonnull APXClientDevice *)deviceInfo;
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
Get information on the current iDevice.
|
|
808
|
+
@brief Method gets information on the current iDevice.
|
|
809
|
+
<pre><code>
|
|
810
|
+
[[Appoxee shared] deviceInformationwithCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
811
|
+
|
|
812
|
+
if (!appoxeeError && [data isKindOfClass:[APXClientDevice class]]) {
|
|
813
|
+
|
|
814
|
+
APXClientDevice *device = (APXClientDevice *)data;
|
|
815
|
+
}
|
|
816
|
+
}];
|
|
817
|
+
</code></pre>
|
|
818
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
819
|
+
*/
|
|
820
|
+
- (void)deviceInformationwithCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
821
|
+
|
|
822
|
+
#pragma mark - Inbox API
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
Standalone Feature
|
|
826
|
+
Inbox API for getting Inbox Messages.
|
|
827
|
+
@brief Method for getting all of the Rich messages associated with a device.
|
|
828
|
+
@attention Standalone Feature.
|
|
829
|
+
<pre><code>
|
|
830
|
+
[[Appoxee shared] getRichMessagesWithHandler:^(NSError *appoxeeError, id data) {
|
|
831
|
+
|
|
832
|
+
if (!appoxeeError) {
|
|
833
|
+
|
|
834
|
+
NSArray *messages = (NSArray *)data; // all objects in array are of type APXRichMessage
|
|
835
|
+
}
|
|
836
|
+
}];
|
|
837
|
+
</code></pre>
|
|
838
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
839
|
+
*/
|
|
840
|
+
- (void)getRichMessagesWithHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
Standalone Feature
|
|
844
|
+
Inbox API for deleting a Rich Message.
|
|
845
|
+
@brief Method that deletes a Rich Message from Inbox.
|
|
846
|
+
@attention Standalone Feature.
|
|
847
|
+
<pre><code>
|
|
848
|
+
[[Appoxee shared] deleteRichMessage:richMessage withHandler:^(NSError *appoxeeError, id data) {
|
|
849
|
+
|
|
850
|
+
if (!appoxeeError) {
|
|
851
|
+
|
|
852
|
+
// refresh UI
|
|
853
|
+
}
|
|
854
|
+
}];
|
|
855
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
856
|
+
*/
|
|
857
|
+
- (void)deleteRichMessage:(nullable APXRichMessage *)richMessage withHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
Standalone Feature
|
|
861
|
+
Refresh Inbox Messages while syncing with Appoxee Servers.
|
|
862
|
+
@brief Method refreshes Inbox Rich Messages while synching data with Appoxee Servers.
|
|
863
|
+
@attention Standalone Feature.
|
|
864
|
+
<pre><code>
|
|
865
|
+
[[Appoxee shared] refreshInboxWithCompletionHandler:^(NSError *appoxeeError, id data) {
|
|
866
|
+
|
|
867
|
+
if (!appoxeeError) {
|
|
868
|
+
|
|
869
|
+
NSArray *messages = (NSArray *)data; // all objects in array are of type APXRichMessage
|
|
870
|
+
}
|
|
871
|
+
}];
|
|
872
|
+
</code></pre>
|
|
873
|
+
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
|
|
874
|
+
*/
|
|
875
|
+
- (void)refreshInboxWithCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
|
|
876
|
+
|
|
877
|
+
@end
|