Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion UnitTests/MPRoktTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ - (void)testSelectPlacementsExpandedWithValidParameters {
NSString *viewName = @"testView";
NSDictionary *attributes = @{@"key": @"value"};
NSDictionary *finalAttributes = @{@"key": @"value", @"sandbox": @"true"};
NSDictionary *placements = @{@"placement": @"test"};
MPRoktEmbeddedView *exampleView = [[MPRoktEmbeddedView alloc] initWithFrame:CGRectZero];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Android it is called RoktEmbeddedView, should we align with the name on both the platforms ? cc: @Mansi-mParticle

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespacing isn't available in Objective C or Swift so adding prefixes is the standard way of preventing naming collisions.

NSDictionary *placements = @{@"placement": exampleView};
void (^onLoad)(void) = ^{};
void (^onUnLoad)(void) = ^{};
void (^onShouldShowLoadingIndicator)(void) = ^{};
Expand Down
3 changes: 2 additions & 1 deletion mParticle-Apple-SDK/Include/MPKitProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
@class MPConsentState;
@class FilteredMParticleUser;
@class FilteredMPIdentityApiRequest;
@class MPRoktEmbeddedView;

#if TARGET_OS_IOS == 1 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
@class UNUserNotificationCenter;
Expand Down Expand Up @@ -136,7 +137,7 @@
#pragma mark First Party Kits
- (nonnull MPKitExecStatus *)executeWithViewName:(NSString * _Nullable)viewName
attributes:(NSDictionary<NSString *, NSString *> * _Nonnull)attributes
placements:(NSDictionary<NSString *, id> * _Nullable)placements
placements:(NSDictionary<NSString *, MPRoktEmbeddedView *> * _Nullable)placements
onLoad:(void (^ _Nullable)(void))onLoad
onUnLoad:(void (^ _Nullable)(void))onUnLoad
onShouldShowLoadingIndicator:(void (^ _Nullable)(void))onShouldShowLoadingIndicator
Expand Down
6 changes: 5 additions & 1 deletion mParticle-Apple-SDK/Include/mParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ NS_ASSUME_NONNULL_BEGIN

@end

@interface MPRoktEmbeddedView : UIView

@end

@interface MPRokt : NSObject

- (void)selectPlacements:(NSString *)identifier
attributes:(NSDictionary<NSString *, NSString *> * _Nullable)attributes;

- (void)selectPlacements:(NSString *)identifier
attributes:(NSDictionary<NSString *, NSString *> * _Nullable)attributes
placements:(NSDictionary<NSString *, id> * _Nullable)placements
placements:(NSDictionary<NSString *, MPRoktEmbeddedView *> * _Nullable)placements
onLoad:(void (^ _Nullable)(void))onLoad
onUnLoad:(void (^ _Nullable)(void))onUnLoad
onShouldShowLoadingIndicator:(void (^ _Nullable)(void))onShouldShowLoadingIndicator
Expand Down
5 changes: 4 additions & 1 deletion mParticle-Apple-SDK/mParticle.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ - (NSString *)description {
@implementation MPDataPlanOptions
@end

@implementation MPRoktEmbeddedView
@end

@implementation MPRokt

- (void)selectPlacements:(NSString *)identifier
Expand All @@ -168,7 +171,7 @@ - (void)selectPlacements:(NSString *)identifier

- (void)selectPlacements:(NSString *)identifier
attributes:(NSDictionary<NSString *, NSString *> * _Nullable)attributes
placements:(NSDictionary<NSString *, id> * _Nullable)placements
placements:(NSDictionary<NSString *, MPRoktEmbeddedView *> * _Nullable)placements
onLoad:(void (^ _Nullable)(void))onLoad
onUnLoad:(void (^ _Nullable)(void))onUnLoad
onShouldShowLoadingIndicator:(void (^ _Nullable)(void))onShouldShowLoadingIndicator
Expand Down