pushwoosh-react-native-plugin 6.1.33 → 6.1.34
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/.github/ISSUE_TEMPLATE/bug_report.yml +1 -0
- package/package.json +1 -1
- package/pushwoosh-react-native-plugin.podspec +2 -2
- package/src/android/build.gradle +1 -1
- package/src/ios/PushwooshPlugin/Pushwoosh.m +112 -44
- package/src/ios/PWAppDelegate.h +0 -20
- package/src/ios/PWGDPRManager.h +0 -46
- package/src/ios/PWIInboxStyle.h +0 -122
- package/src/ios/PWIInboxUI.h +0 -39
- package/src/ios/PWInAppManager.h +0 -176
- package/src/ios/PWInbox.h +0 -147
- package/src/ios/PWInlineInAppView.h +0 -26
- package/src/ios/PWLog.h +0 -23
- package/src/ios/PWMessaging.h +0 -20
- package/src/ios/PWNotificationExtensionManager.h +0 -49
- package/src/ios/PWRichMediaManager.h +0 -123
- package/src/ios/PWRichMediaStyle.h +0 -122
- package/src/ios/PushNotificationManager.h +0 -596
- package/src/ios/Pushwoosh.h +0 -684
- package/src/ios/PushwooshFramework.h +0 -705
- package/src/ios/PushwooshInboxBundle.bundle/Info.plist +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/PWIInboxAttachmentViewController.nib +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/PWIInboxMessageViewCell.nib +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/PWIInboxViewController.nib +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/errorMessage@2x.png +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/inbox_icon.png +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/noMessage@2x.png +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/unread.png +0 -0
- package/src/ios/PushwooshInboxUI.h +0 -19
- package/src/ios/PushwooshPlugin.xcodeproj/project.pbxproj +0 -305
- package/src/ios/libPushwoosh.a +0 -0
- package/src/ios/libPushwooshFramework.a +0 -0
- package/src/ios/libPushwooshInboxUI.a +0 -0
|
@@ -58,6 +58,7 @@ body:
|
|
|
58
58
|
label: Your Pushwoosh React Native Plugin version
|
|
59
59
|
description: Your React Native Plugin version which was integrated to the app. You may find it on the [releases page](https://github.com/Pushwoosh/pushwoosh-react-native-plugin/releases)
|
|
60
60
|
options:
|
|
61
|
+
- 6.1.34
|
|
61
62
|
- 6.1.32
|
|
62
63
|
- 6.1.31
|
|
63
64
|
- 6.1.30
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Pod::Spec.new do |s|
|
|
2
2
|
s.name = "pushwoosh-react-native-plugin"
|
|
3
|
-
s.version = "6.1.
|
|
3
|
+
s.version = "6.1.34"
|
|
4
4
|
s.summary = "React Native Pushwoosh Push Notifications module"
|
|
5
5
|
s.requires_arc = true
|
|
6
6
|
s.author = 'Pushwoosh'
|
|
@@ -15,6 +15,6 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.static_framework = true
|
|
16
16
|
|
|
17
17
|
s.dependency 'React'
|
|
18
|
-
s.dependency 'PushwooshXCFramework'
|
|
18
|
+
s.dependency 'PushwooshXCFramework', '6.7.9'
|
|
19
19
|
s.dependency 'PushwooshInboxUIXCFramework'
|
|
20
20
|
end
|
package/src/android/build.gradle
CHANGED
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
#import <objc/runtime.h>
|
|
19
19
|
|
|
20
|
+
#define kPushwooshPluginImplementationInfoPlistKey @"Pushwoosh_PLUGIN_NOTIFICATION_HANDLER"
|
|
21
|
+
|
|
20
22
|
static id objectOrNull(id object) {
|
|
21
23
|
if (object) {
|
|
22
24
|
return object;
|
|
@@ -56,16 +58,18 @@ void pushwoosh_swizzle(Class class, SEL fromChange, SEL toChange, IMP impl, cons
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
@implementation PushwooshPlugin
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
@implementation PushwooshPlugin {
|
|
62
|
+
NSString *lastPushwooshHash;
|
|
63
|
+
|
|
64
|
+
API_AVAILABLE(ios(10))
|
|
65
|
+
__weak id<UNUserNotificationCenterDelegate> _originalNotificationCenterDelegate;
|
|
66
|
+
API_AVAILABLE(ios(10))
|
|
67
|
+
struct {
|
|
68
|
+
unsigned int willPresentNotification : 1;
|
|
69
|
+
unsigned int didReceiveNotificationResponse : 1;
|
|
70
|
+
unsigned int openSettingsForNotification : 1;
|
|
71
|
+
} _originalNotificationCenterDelegateResponds;
|
|
72
|
+
}
|
|
69
73
|
|
|
70
74
|
#pragma mark - Pushwoosh RCTBridgeModule
|
|
71
75
|
|
|
@@ -75,6 +79,10 @@ RCT_EXPORT_MODULE(Pushwoosh);
|
|
|
75
79
|
return dispatch_get_main_queue();
|
|
76
80
|
}
|
|
77
81
|
|
|
82
|
+
+ (NSString *)getPluginImplementationInfoPlistKey {
|
|
83
|
+
return [[NSBundle mainBundle] objectForInfoDictionaryKey:kPushwooshPluginImplementationInfoPlistKey];
|
|
84
|
+
}
|
|
85
|
+
|
|
78
86
|
RCT_EXPORT_METHOD(init:(NSDictionary*)config success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error) {
|
|
79
87
|
NSString *appCode = config[@"pw_appid"];
|
|
80
88
|
NSString *notificationHandling = config[@"pw_notification_handling"];
|
|
@@ -100,35 +108,39 @@ RCT_EXPORT_METHOD(init:(NSDictionary*)config success:(RCTResponseSenderBlock)suc
|
|
|
100
108
|
|
|
101
109
|
// We set Pushwoosh UNUserNotificationCenter delegate unless CUSTOM is specified in the config
|
|
102
110
|
if(![notificationHandling isEqualToString:@"CUSTOM"]) {
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
if (![PushwooshPlugin getPluginImplementationInfoPlistKey]) {
|
|
112
|
+
[UNUserNotificationCenter currentNotificationCenter].delegate = [PushNotificationManager pushManager].notificationCenterDelegate;
|
|
113
|
+
} else {
|
|
114
|
+
if (@available(iOS 10, *)) {
|
|
115
|
+
BOOL shouldReplaceDelegate = YES;
|
|
116
|
+
|
|
117
|
+
UNUserNotificationCenter *notificationCenter = [UNUserNotificationCenter currentNotificationCenter];
|
|
118
|
+
|
|
108
119
|
#if !TARGET_OS_OSX
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
120
|
+
if ([notificationCenter.delegate conformsToProtocol:@protocol(PushNotificationDelegate)]) {
|
|
121
|
+
shouldReplaceDelegate = NO;
|
|
122
|
+
}
|
|
112
123
|
#endif
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
|
|
125
|
+
if (notificationCenter.delegate != nil && shouldReplaceDelegate) {
|
|
126
|
+
_originalNotificationCenterDelegate = notificationCenter.delegate;
|
|
127
|
+
_originalNotificationCenterDelegateResponds.openSettingsForNotification =
|
|
128
|
+
(unsigned int)[_originalNotificationCenterDelegate
|
|
129
|
+
respondsToSelector:@selector(userNotificationCenter:openSettingsForNotification:)];
|
|
130
|
+
_originalNotificationCenterDelegateResponds.willPresentNotification =
|
|
131
|
+
(unsigned int)[_originalNotificationCenterDelegate
|
|
132
|
+
respondsToSelector:@selector(userNotificationCenter:
|
|
133
|
+
willPresentNotification:withCompletionHandler:)];
|
|
134
|
+
_originalNotificationCenterDelegateResponds.didReceiveNotificationResponse =
|
|
135
|
+
(unsigned int)[_originalNotificationCenterDelegate
|
|
136
|
+
respondsToSelector:@selector(userNotificationCenter:
|
|
137
|
+
didReceiveNotificationResponse:withCompletionHandler:)];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (shouldReplaceDelegate) {
|
|
141
|
+
__strong PushwooshPlugin<UNUserNotificationCenterDelegate> *strongSelf = (PushwooshPlugin<UNUserNotificationCenterDelegate> *)self;
|
|
142
|
+
notificationCenter.delegate = (id<UNUserNotificationCenterDelegate>)strongSelf;
|
|
143
|
+
}
|
|
132
144
|
}
|
|
133
145
|
}
|
|
134
146
|
}
|
|
@@ -460,12 +472,37 @@ void pwplugin_didFailToRegisterForRemoteNotificationsWithError(id self, SEL _cmd
|
|
|
460
472
|
(void (^)(UNNotificationPresentationOptions options))completionHandler
|
|
461
473
|
API_AVAILABLE(ios(10.0)) {
|
|
462
474
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
475
|
+
UNMutableNotificationContent *content = notification.request.content.mutableCopy;
|
|
476
|
+
BOOL isPushwooshMessage = [PWMessage isPushwooshMessage:notification.request.content.userInfo];
|
|
477
|
+
NSString *currentHash = content.userInfo[@"p"];
|
|
478
|
+
BOOL isNeedToImplementInPlugin = [[PushwooshPlugin getPluginImplementationInfoPlistKey] boolValue];
|
|
479
|
+
|
|
480
|
+
if (isPushwooshMessage && isNeedToImplementInPlugin && ![lastPushwooshHash isEqualToString:currentHash]) {
|
|
481
|
+
lastPushwooshHash = currentHash;
|
|
482
|
+
|
|
483
|
+
if ([PushNotificationManager pushManager].showPushnotificationAlert) {
|
|
484
|
+
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionAlert);
|
|
485
|
+
} else {
|
|
486
|
+
[[PushNotificationManager pushManager] handlePushReceived:content.userInfo];
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
[self sendJSEvent:kPushReceivedJSEvent withArgs:content.userInfo];
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
if (_originalNotificationCenterDelegate != nil &&
|
|
493
|
+
_originalNotificationCenterDelegateResponds.willPresentNotification) {
|
|
494
|
+
|
|
495
|
+
dispatch_block_t presentationBlock = ^{
|
|
496
|
+
[self->_originalNotificationCenterDelegate userNotificationCenter:center
|
|
497
|
+
willPresentNotification:notification
|
|
498
|
+
withCompletionHandler:completionHandler];
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
if (isPushwooshMessage) {
|
|
502
|
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.59 * NSEC_PER_SEC)), dispatch_get_main_queue(), presentationBlock);
|
|
503
|
+
} else {
|
|
504
|
+
presentationBlock();
|
|
505
|
+
}
|
|
469
506
|
}
|
|
470
507
|
|
|
471
508
|
if (_originalNotificationCenterDelegate != nil &&
|
|
@@ -493,6 +530,8 @@ API_AVAILABLE(ios(10.0)) {
|
|
|
493
530
|
didReceiveNotificationResponse:(UNNotificationResponse *)response
|
|
494
531
|
withCompletionHandler:(void (^)(void))completionHandler
|
|
495
532
|
API_AVAILABLE(ios(10.0)) {
|
|
533
|
+
BOOL isNeedToImplementInPlugin = [[PushwooshPlugin getPluginImplementationInfoPlistKey] boolValue];
|
|
534
|
+
|
|
496
535
|
dispatch_block_t handlePushAcceptanceBlock = ^{
|
|
497
536
|
if (![response.actionIdentifier isEqualToString:UNNotificationDismissActionIdentifier]) {
|
|
498
537
|
if (![response.actionIdentifier isEqualToString:UNNotificationDefaultActionIdentifier] && [[PushNotificationManager pushManager].delegate respondsToSelector:@selector(onActionIdentifierReceived:withNotification:)]) {
|
|
@@ -501,7 +540,13 @@ API_AVAILABLE(ios(10.0)) {
|
|
|
501
540
|
}
|
|
502
541
|
};
|
|
503
542
|
|
|
504
|
-
if ([self isRemoteNotification:response.notification]
|
|
543
|
+
if ([self isRemoteNotification:response.notification] && [PWMessage isPushwooshMessage:response.notification.request.content.userInfo]) {
|
|
544
|
+
NSDictionary *userInfo = response.notification.request.content.userInfo;
|
|
545
|
+
|
|
546
|
+
if (isNeedToImplementInPlugin) {
|
|
547
|
+
[[PushNotificationManager pushManager] handlePushAccepted:userInfo onStart:[self isOnStart:userInfo]];
|
|
548
|
+
}
|
|
549
|
+
|
|
505
550
|
handlePushAcceptanceBlock();
|
|
506
551
|
} else if ([response.notification.request.content.userInfo objectForKey:@"pw_push"]) {
|
|
507
552
|
handlePushAcceptanceBlock();
|
|
@@ -517,6 +562,29 @@ API_AVAILABLE(ios(10.0)) {
|
|
|
517
562
|
}
|
|
518
563
|
}
|
|
519
564
|
|
|
565
|
+
- (BOOL)isOnStart:(NSDictionary *)userInfo {
|
|
566
|
+
NSDictionary *pushStartDictionary = [self startPushInfoFromInfoDictionary:userInfo];
|
|
567
|
+
return pushStartDictionary != nil;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
- (NSDictionary *)startPushInfoFromInfoDictionary:(NSDictionary *)userInfo {
|
|
571
|
+
//try as launchOptions dictionary
|
|
572
|
+
NSDictionary *pushDict = userInfo[UIApplicationLaunchOptionsRemoteNotificationKey];
|
|
573
|
+
if (pushDict == nil) {
|
|
574
|
+
id notification = userInfo[UIApplicationLaunchOptionsLocalNotificationKey];
|
|
575
|
+
|
|
576
|
+
if (notification && [notification isKindOfClass:[UILocalNotification class]]) {
|
|
577
|
+
pushDict = [notification userInfo];
|
|
578
|
+
|
|
579
|
+
if (pushDict[@"pw_push"] == nil) {
|
|
580
|
+
pushDict = nil;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
return pushDict;
|
|
586
|
+
}
|
|
587
|
+
|
|
520
588
|
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
|
521
589
|
openSettingsForNotification:(nullable UNNotification *)notification
|
|
522
590
|
API_AVAILABLE(ios(10.0)) {
|
package/src/ios/PWAppDelegate.h
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// PWAppDelegate.h
|
|
3
|
-
// Pushwoosh SDK
|
|
4
|
-
// (c) Pushwoosh 2018
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
#if TARGET_OS_IPHONE
|
|
8
|
-
|
|
9
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
|
|
11
|
-
/*
|
|
12
|
-
Base AppDelegate class for easier integration.
|
|
13
|
-
*/
|
|
14
|
-
@interface PWAppDelegate : UIResponder <UIApplicationDelegate>
|
|
15
|
-
|
|
16
|
-
@property (nonatomic, strong) UIWindow *window;
|
|
17
|
-
|
|
18
|
-
@end
|
|
19
|
-
|
|
20
|
-
#endif
|
package/src/ios/PWGDPRManager.h
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// PWGDPRManager.h
|
|
3
|
-
// Pushwoosh SDK
|
|
4
|
-
// (c) Pushwoosh 2018
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
#import <Foundation/Foundation.h>
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
`PWGDPRManager` class offers access to the singleton-instance of the manager responsible for channels management required by GDPR.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
FOUNDATION_EXPORT NSString * const PWGDPRStatusDidChangeNotification;
|
|
14
|
-
|
|
15
|
-
@interface PWGDPRManager : NSObject
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
Indicates availability of the GDPR compliance solution.
|
|
19
|
-
*/
|
|
20
|
-
@property (nonatomic, readonly, getter=isAvailable) BOOL available;
|
|
21
|
-
|
|
22
|
-
@property (nonatomic, readonly, getter=isCommunicationEnabled) BOOL communicationEnabled;
|
|
23
|
-
|
|
24
|
-
@property (nonatomic, readonly, getter=isDeviceDataRemoved) BOOL deviceDataRemoved;
|
|
25
|
-
|
|
26
|
-
+ (instancetype)sharedManager;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
Enable/disable all communication with Pushwoosh. Enabled by default.
|
|
30
|
-
*/
|
|
31
|
-
- (void)setCommunicationEnabled:(BOOL)enabled completion:(void (^)(NSError *error))completion;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
Removes all device data from Pushwoosh and stops all interactions and communication permanently.
|
|
35
|
-
*/
|
|
36
|
-
- (void)removeAllDeviceDataWithCompletion:(void (^)(NSError *error))completion;
|
|
37
|
-
|
|
38
|
-
#if TARGET_OS_IOS || TARGET_OS_OSX
|
|
39
|
-
|
|
40
|
-
- (void)showGDPRConsentUI;
|
|
41
|
-
|
|
42
|
-
- (void)showGDPRDeletionUI;
|
|
43
|
-
|
|
44
|
-
#endif
|
|
45
|
-
|
|
46
|
-
@end
|
package/src/ios/PWIInboxStyle.h
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// PWIInboxStyle.h
|
|
3
|
-
// PushwooshInboxUI
|
|
4
|
-
//
|
|
5
|
-
// Created by Pushwoosh on 01/11/2017.
|
|
6
|
-
// Copyright © 2017 Pushwoosh. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
#import <UIKit/UIKit.h>
|
|
11
|
-
|
|
12
|
-
typedef NSString * (^PWIDateFormatterBlock)(NSDate *date, NSObject *owner);
|
|
13
|
-
|
|
14
|
-
//! This class is designed to customize the Inbox appearance
|
|
15
|
-
@interface PWIInboxStyle : NSObject
|
|
16
|
-
|
|
17
|
-
//! This block customizes the date formatting
|
|
18
|
-
@property (nonatomic, readwrite) PWIDateFormatterBlock dateFormatterBlock;
|
|
19
|
-
|
|
20
|
-
//! The default icon in the cell next to the message; if not specified, the app icon is used
|
|
21
|
-
@property (nonatomic, readwrite) UIImage *defaultImageIcon;
|
|
22
|
-
|
|
23
|
-
//! The default font
|
|
24
|
-
@property (nonatomic, readwrite) UIFont *defaultFont;
|
|
25
|
-
|
|
26
|
-
//! The default text color
|
|
27
|
-
@property (nonatomic, readwrite) UIColor *defaultTextColor;
|
|
28
|
-
|
|
29
|
-
//! The text color of a read notification
|
|
30
|
-
@property (nonatomic, readwrite) UIColor *readTextColor;
|
|
31
|
-
|
|
32
|
-
//! The default background color
|
|
33
|
-
@property (nonatomic, readwrite) UIColor *backgroundColor;
|
|
34
|
-
|
|
35
|
-
//! The default selection color
|
|
36
|
-
@property (nonatomic, readwrite) UIColor *selectionColor;
|
|
37
|
-
|
|
38
|
-
//! The appearance of the unread messages mark
|
|
39
|
-
@property (nonatomic, readwrite) UIImage *unreadImage;
|
|
40
|
-
|
|
41
|
-
//! The image which is displayed if an error occurs and the list of inbox messages is empty
|
|
42
|
-
@property (nonatomic, readwrite) UIImage *listErrorImage;
|
|
43
|
-
|
|
44
|
-
//! The error text which is displayed when an error occurs; cannot be localized
|
|
45
|
-
@property (nonatomic, readwrite) NSString *listErrorMessage;
|
|
46
|
-
|
|
47
|
-
//! The image which is displayed if the list of inbox messages is empty
|
|
48
|
-
@property (nonatomic, readwrite) UIImage *listEmptyImage;
|
|
49
|
-
|
|
50
|
-
//! The text which is displayed if the list of inbox messages is empty; cannot be localized
|
|
51
|
-
@property (nonatomic, readwrite) NSString *listEmptyMessage;
|
|
52
|
-
|
|
53
|
-
//! The accent color
|
|
54
|
-
@property (nonatomic, readwrite) UIColor *accentColor;
|
|
55
|
-
|
|
56
|
-
//! The color of message titles
|
|
57
|
-
@property (nonatomic, readwrite) UIColor *titleColor;
|
|
58
|
-
|
|
59
|
-
//! The title color for read notifications
|
|
60
|
-
@property (nonatomic, readwrite) UIColor *readTitleColor;
|
|
61
|
-
|
|
62
|
-
//! The color of messages descriptions
|
|
63
|
-
@property (nonatomic, readwrite) UIColor *descriptionColor;
|
|
64
|
-
|
|
65
|
-
//! The color of message dates
|
|
66
|
-
@property (nonatomic, readwrite) UIColor *dateColor;
|
|
67
|
-
|
|
68
|
-
//! The color of the separator
|
|
69
|
-
@property (nonatomic, readwrite) UIColor *separatorColor;
|
|
70
|
-
|
|
71
|
-
//! The font of message titles
|
|
72
|
-
@property (nonatomic, readwrite) UIFont *titleFont;
|
|
73
|
-
|
|
74
|
-
//! The font of message descriptions
|
|
75
|
-
@property (nonatomic, readwrite) UIFont *descriptionFont;
|
|
76
|
-
|
|
77
|
-
//! The font of message dates
|
|
78
|
-
@property (nonatomic, readwrite) UIFont *dateFont;
|
|
79
|
-
|
|
80
|
-
//! The default bar color
|
|
81
|
-
@property (nonatomic, readwrite) UIColor *barBackgroundColor;
|
|
82
|
-
|
|
83
|
-
//! The default back button color
|
|
84
|
-
@property(nonatomic, readwrite) UIColor *barAccentColor;
|
|
85
|
-
|
|
86
|
-
//! The default bar accent color
|
|
87
|
-
@property (nonatomic, readwrite) UIColor *barTextColor;
|
|
88
|
-
|
|
89
|
-
//! The default bar title text
|
|
90
|
-
@property (nonatomic, readwrite) NSString *barTitle;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
The method returning the default style; all parameters might be changed
|
|
94
|
-
|
|
95
|
-
@retutn instance of default style
|
|
96
|
-
*/
|
|
97
|
-
+ (instancetype)defaultStyle;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
This method updates the default style for PWInboxViewController
|
|
101
|
-
|
|
102
|
-
@param style the new default style for PWInboxViewController
|
|
103
|
-
*/
|
|
104
|
-
+ (void)setupDefaultStyle:(PWIInboxStyle *)style;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
The method filling style's fields based on following parameters: icon, textColor, accentColor, date; all parameters might be changed
|
|
108
|
-
*/
|
|
109
|
-
+ (instancetype)customStyleWithDefaultImageIcon:(UIImage *)icon
|
|
110
|
-
textColor:(UIColor *)textColor
|
|
111
|
-
accentColor:(UIColor *)accentColor
|
|
112
|
-
font:(UIFont *)font;
|
|
113
|
-
/**
|
|
114
|
-
The method filling style's fields based on following parameters: icon, textColor, accentColor, font, dateFormatterBlock; all parameters might be changed
|
|
115
|
-
*/
|
|
116
|
-
+ (instancetype)customStyleWithDefaultImageIcon:(UIImage *)icon
|
|
117
|
-
textColor:(UIColor *)textColor
|
|
118
|
-
accentColor:(UIColor *)accentColor
|
|
119
|
-
font:(UIFont *)font
|
|
120
|
-
dateFromatterBlock:(PWIDateFormatterBlock)dateFormatterBlock;
|
|
121
|
-
|
|
122
|
-
@end
|
package/src/ios/PWIInboxUI.h
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// PWIInboxUI.h
|
|
3
|
-
// PushwooshInboxUI
|
|
4
|
-
//
|
|
5
|
-
// Created by Pushwoosh on 01/11/2017.
|
|
6
|
-
// Copyright © 2017 Pushwoosh. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
#import <UIKit/UIKit.h>
|
|
11
|
-
|
|
12
|
-
@protocol PWInboxMessageProtocol;
|
|
13
|
-
|
|
14
|
-
@interface PWIInboxViewController : UIViewController
|
|
15
|
-
|
|
16
|
-
@property (nonatomic) void (^onMessageClickBlock)(id<PWInboxMessageProtocol> message);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
Reloads everything from scratch.
|
|
20
|
-
*/
|
|
21
|
-
- (void)reloadData;
|
|
22
|
-
- (instancetype)init NS_UNAVAILABLE;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
@class PWIInboxStyle;
|
|
27
|
-
@interface PWIInboxUI : NSObject
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
@return PWIInboxViewController with a specified style
|
|
31
|
-
*/
|
|
32
|
-
+ (PWIInboxViewController *)createInboxControllerWithStyle:(PWIInboxStyle *)style;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
@return PWIInboxViewController with a specified style and height of table view
|
|
36
|
-
*/
|
|
37
|
-
+ (PWIInboxViewController *)createInboxControllerWithStyle:(PWIInboxStyle *)style andContentHeight:(CGFloat)contentHeight;
|
|
38
|
-
|
|
39
|
-
@end
|
package/src/ios/PWInAppManager.h
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// PWInAppManager.h
|
|
3
|
-
// Pushwoosh SDK
|
|
4
|
-
// (c) Pushwoosh 2017
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
#import <Foundation/Foundation.h>
|
|
8
|
-
|
|
9
|
-
#if TARGET_OS_IOS
|
|
10
|
-
|
|
11
|
-
#import <WebKit/WebKit.h>
|
|
12
|
-
/**
|
|
13
|
-
`PWJavaScriptInterface` protocol is a representation of Javascript object that can be added at runtime into In-App Message HTML page
|
|
14
|
-
to provide native calls and callbacks to Objective-C/Swift.
|
|
15
|
-
|
|
16
|
-
Example:
|
|
17
|
-
|
|
18
|
-
Objective-C:
|
|
19
|
-
@code
|
|
20
|
-
@implementation JavaScriptInterface
|
|
21
|
-
|
|
22
|
-
- (void)nativeCall:(NSString*)str :(PWJavaScriptCallback*)callback {
|
|
23
|
-
[callback executeWithParam:str];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@end
|
|
27
|
-
|
|
28
|
-
...
|
|
29
|
-
|
|
30
|
-
[[PWInAppManager sharedManager] addJavascriptInterface:[JavaScriptInterface new] withName:@"ObjC"];
|
|
31
|
-
@endcode
|
|
32
|
-
|
|
33
|
-
JavaScript:
|
|
34
|
-
@code
|
|
35
|
-
ObjC.nativeCall("exampleString", function(str) {
|
|
36
|
-
console.log(str);
|
|
37
|
-
});
|
|
38
|
-
@endcode
|
|
39
|
-
*/
|
|
40
|
-
@protocol PWJavaScriptInterface
|
|
41
|
-
|
|
42
|
-
@optional
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
Tells the delegate that In-App Message load stated
|
|
46
|
-
*/
|
|
47
|
-
- (void)onWebViewStartLoad:(WKWebView *)webView;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
Tells the delegate that In-App Message load finished
|
|
51
|
-
*/
|
|
52
|
-
- (void)onWebViewFinishLoad:(WKWebView *)webView;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
Tells the delegate that In-App Message is closing
|
|
56
|
-
*/
|
|
57
|
-
- (void)onWebViewStartClose:(WKWebView *)webView;
|
|
58
|
-
|
|
59
|
-
@end
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
`PWJavaScriptCallback` is a representation of Javascript function
|
|
63
|
-
*/
|
|
64
|
-
@interface PWJavaScriptCallback : NSObject
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
Invokes callback with no arguments
|
|
68
|
-
*/
|
|
69
|
-
- (NSString*) execute;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
Invokes callback with one argument
|
|
73
|
-
*/
|
|
74
|
-
- (NSString*) executeWithParam: (NSString*) param;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
Invokes callback with multiple arguments
|
|
78
|
-
*/
|
|
79
|
-
- (NSString*) executeWithParams: (NSArray*) params;
|
|
80
|
-
|
|
81
|
-
@end
|
|
82
|
-
|
|
83
|
-
#endif
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/*
|
|
87
|
-
`PWInAppManager` class offers access to the singleton-instance of the inapp messages manager responsible for sending events and managing inapp message notifications.
|
|
88
|
-
*/
|
|
89
|
-
@interface PWInAppManager : NSObject
|
|
90
|
-
|
|
91
|
-
+ (instancetype)sharedManager;
|
|
92
|
-
|
|
93
|
-
+ (void)updateInAppManagerInstance;
|
|
94
|
-
|
|
95
|
-
#if TARGET_OS_IOS || TARGET_OS_OSX
|
|
96
|
-
/**
|
|
97
|
-
Resets capping of the Pushwoosh out-of-the-box In-App solutions.
|
|
98
|
-
*/
|
|
99
|
-
- (void)resetBusinessCasesFrequencyCapping;
|
|
100
|
-
|
|
101
|
-
#endif
|
|
102
|
-
/**
|
|
103
|
-
Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
|
|
104
|
-
This allows data and events to be matched across multiple user devices.
|
|
105
|
-
*/
|
|
106
|
-
- (void)setUserId:(NSString *)userId;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
|
|
110
|
-
This allows data and events to be matched across multiple user devices.
|
|
111
|
-
If setUser succeeds competion is called with nil argument. If setUser fails completion is called with error.
|
|
112
|
-
*/
|
|
113
|
-
- (void)setUserId:(NSString *)userId completion:(void(^)(NSError * error))completion;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
|
|
117
|
-
This allows data and events to be matched across multiple user devices.
|
|
118
|
-
|
|
119
|
-
@param userId user identifier
|
|
120
|
-
@param emails user's emails array
|
|
121
|
-
*/
|
|
122
|
-
- (void)setUser:(NSString *)userId emails:(NSArray *)emails completion:(void(^)(NSError * error))completion;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
Register emails list associated to the current user.
|
|
126
|
-
|
|
127
|
-
@param emails user's emails array
|
|
128
|
-
*/
|
|
129
|
-
- (void)setEmails:(NSArray *)emails completion:(void(^)(NSError * error))completion;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
Move all events from oldUserId to newUserId if doMerge is true. If doMerge is false all events for oldUserId are removed.
|
|
133
|
-
|
|
134
|
-
@param oldUserId source user
|
|
135
|
-
@param newUserId destination user
|
|
136
|
-
@param doMerge if false all events for oldUserId are removed, if true all events for oldUserId are moved to newUserId
|
|
137
|
-
@param completion callback
|
|
138
|
-
*/
|
|
139
|
-
- (void)mergeUserId:(NSString *)oldUserId to:(NSString *)newUserId doMerge:(BOOL)doMerge completion:(void (^)(NSError *error))completion;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
Post events for In-App Messages. This can trigger In-App message display as specified in Pushwoosh Control Panel.
|
|
143
|
-
|
|
144
|
-
Example:
|
|
145
|
-
@code
|
|
146
|
-
[[PWInAppManager sharedManager] setUserId:@"96da2f590cd7246bbde0051047b0d6f7"];
|
|
147
|
-
[[PWInAppManager sharedManager] postEvent:@"buttonPressed" withAttributes:@{ @"buttonNumber" : @"4", @"buttonLabel" : @"Banner" } completion:nil];
|
|
148
|
-
@endcode
|
|
149
|
-
|
|
150
|
-
@param event name of the event
|
|
151
|
-
@param attributes NSDictionary of event attributes
|
|
152
|
-
@param completion function to call after posting event
|
|
153
|
-
*/
|
|
154
|
-
- (void)postEvent:(NSString *)event withAttributes:(NSDictionary *)attributes completion:(void (^)(NSError *error))completion;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
See `postEvent:withAttributes:completion:`
|
|
158
|
-
*/
|
|
159
|
-
- (void)postEvent:(NSString *)event withAttributes:(NSDictionary *)attributes;
|
|
160
|
-
|
|
161
|
-
#if TARGET_OS_IOS
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
Adds javascript interface for In-App Messages. Interface will be accessible from javascript as object with specified `name` and functions defined in `interface` class.
|
|
165
|
-
*/
|
|
166
|
-
- (void)addJavascriptInterface:(NSObject<PWJavaScriptInterface>*)interface withName:(NSString*)name;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
Updates In-App messages storage on a device
|
|
170
|
-
*/
|
|
171
|
-
|
|
172
|
-
- (void)reloadInAppsWithCompletion: (void (^)(NSError *error))completion;
|
|
173
|
-
|
|
174
|
-
#endif
|
|
175
|
-
|
|
176
|
-
@end
|