Skip to content

Commit b07439f

Browse files
Revert "feat: Implement Manual SceneDelegate Support (#453)"
This reverts commit e5cbe84.
1 parent e5cbe84 commit b07439f

File tree

6 files changed

+11
-165
lines changed

6 files changed

+11
-165
lines changed

UnitTests/ObjCTests/MPKitConfigurationTests.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ - (void)tearDown {
8181

8282
- (void)testInstance {
8383
XCTAssertNotNil(kitConfiguration);
84-
XCTAssertEqualObjects(kitConfiguration.configurationHash, @(969680750));
84+
XCTAssertEqualObjects(kitConfiguration.configurationHash, @(762651950));
8585
XCTAssertEqualObjects(kitConfiguration.integrationId, @37);
8686
XCTAssertEqualObjects(kitConfiguration.attributeValueFilteringHashedAttribute, @"12345");
8787
XCTAssertEqualObjects(kitConfiguration.attributeValueFilteringHashedValue, @"54321");
@@ -183,7 +183,7 @@ - (void)testInvalidConfiguration {
183183

184184
kitConfig = [[MPKitConfiguration alloc] initWithDictionary:configuration];
185185
XCTAssertNotNil(kitConfig);
186-
XCTAssertEqualObjects(kitConfig.configurationHash, @(-1872513399));
186+
XCTAssertEqualObjects(kitConfig.configurationHash, @(1495473349));
187187
XCTAssertEqualObjects(kitConfig.integrationId, @80);
188188

189189
XCTAssertNil(kitConfig.filters);

UnitTests/SwiftTests/MParticle/MParticleSceneDelegateTests.swift

Lines changed: 0 additions & 76 deletions
This file was deleted.

mParticle-Apple-SDK.xcodeproj/project.pbxproj

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,6 @@
566566
7E0387842DB913D2003B7D5E /* MPRokt.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E0387802DB913D2003B7D5E /* MPRokt.m */; };
567567
7E15B2062D94617900C1FF3E /* MPRoktTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E15B2052D94617900C1FF3E /* MPRoktTests.m */; };
568568
7E15B2072D94617900C1FF3E /* MPRoktTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E15B2052D94617900C1FF3E /* MPRoktTests.m */; };
569-
7E573D2A2ECB65D90087185D /* MParticleSceneDelegateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E573D292ECB65D90087185D /* MParticleSceneDelegateTests.swift */; };
570-
7E573D2B2ECB65D90087185D /* MParticleSceneDelegateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E573D292ECB65D90087185D /* MParticleSceneDelegateTests.swift */; };
571569
B31360F92E012760000DFBC9 /* MPRoktEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = B31360F72E012760000DFBC9 /* MPRoktEvent.swift */; };
572570
B3D778622E02F55F00D887A4 /* MPRoktEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = B31360F72E012760000DFBC9 /* MPRoktEvent.swift */; };
573571
D30CD0CB2CFF5FB100F5148A /* MPStateMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79B0629CDFB1F00E7489F /* MPStateMachine.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -925,7 +923,6 @@
925923
7E03877F2DB913D2003B7D5E /* MPRokt.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPRokt.h; sourceTree = "<group>"; };
926924
7E0387802DB913D2003B7D5E /* MPRokt.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPRokt.m; sourceTree = "<group>"; };
927925
7E15B2052D94617900C1FF3E /* MPRoktTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPRoktTests.m; sourceTree = "<group>"; };
928-
7E573D292ECB65D90087185D /* MParticleSceneDelegateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MParticleSceneDelegateTests.swift; sourceTree = "<group>"; };
929926
B31360F72E012760000DFBC9 /* MPRoktEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPRoktEvent.swift; sourceTree = "<group>"; };
930927
D33C8B312B8510C20012EDFD /* MPAudience.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPAudience.h; sourceTree = "<group>"; };
931928
D33C8B322B8510C20012EDFD /* MPAudience.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPAudience.m; sourceTree = "<group>"; };
@@ -1507,7 +1504,6 @@
15071504
isa = PBXGroup;
15081505
children = (
15091506
7231B8342EB95F9F001565E5 /* MParticleBreadcrumbTests.swift */,
1510-
7E573D292ECB65D90087185D /* MParticleSceneDelegateTests.swift */,
15111507
7231B83E2EB9627D001565E5 /* MParticleErrorTests.swift */,
15121508
7231B83B2EB961F2001565E5 /* MParticleLTVTests.swift */,
15131509
7231B84B2EB963B3001565E5 /* MParticleKitBatchTests.swift */,
@@ -1914,7 +1910,6 @@
19141910
534CD26929CE2CE1008452B3 /* MPSurrogateAppDelegateTests.m in Sources */,
19151911
534CD26A29CE2CE1008452B3 /* MPGDPRConsentTests.m in Sources */,
19161912
356D4A5A2E58B09D00CB69FE /* SettingsProviderMock.swift in Sources */,
1917-
7E573D2A2ECB65D90087185D /* MParticleSceneDelegateTests.swift in Sources */,
19181913
534CD26B29CE2CE1008452B3 /* MPBackendControllerTests.m in Sources */,
19191914
534CD26C29CE2CE1008452B3 /* MPKitConfigurationTests.mm in Sources */,
19201915
7231B80E2EB3C4AC001565E5 /* MPKitMock.swift in Sources */,
@@ -2134,7 +2129,6 @@
21342129
53A79CD129CE019F00E7489F /* MPSurrogateAppDelegateTests.m in Sources */,
21352130
53A79CE729CE019F00E7489F /* MPGDPRConsentTests.m in Sources */,
21362131
356D4A592E58B09D00CB69FE /* SettingsProviderMock.swift in Sources */,
2137-
7E573D2B2ECB65D90087185D /* MParticleSceneDelegateTests.swift in Sources */,
21382132
53A79CD229CE019F00E7489F /* MPBackendControllerTests.m in Sources */,
21392133
53A79CF329CE019F00E7489F /* MPKitConfigurationTests.mm in Sources */,
21402134
7231B80D2EB3C4AC001565E5 /* MPKitMock.swift in Sources */,
@@ -2368,7 +2362,6 @@
23682362
"$(inherited)",
23692363
);
23702364
INFOPLIST_FILE = ./UnitTests/Info.plist;
2371-
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
23722365
MARKETING_VERSION = 1.0;
23732366
PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.mParticle-Apple-SDK-NoLocationTests";
23742367
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2381,7 +2374,6 @@
23812374
SWIFT_OBJC_BRIDGING_HEADER = "./UnitTests/mParticle_iOS_SDKTests-Bridging-Header.h";
23822375
SWIFT_VERSION = 5.0;
23832376
TARGETED_DEVICE_FAMILY = "1,2,3";
2384-
TVOS_DEPLOYMENT_TARGET = 15.6;
23852377
};
23862378
name = Debug;
23872379
};
@@ -2398,7 +2390,6 @@
23982390
"$(inherited)",
23992391
);
24002392
INFOPLIST_FILE = ./UnitTests/Info.plist;
2401-
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
24022393
MARKETING_VERSION = 1.0;
24032394
PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.mParticle-Apple-SDK-NoLocationTests";
24042395
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2411,7 +2402,6 @@
24112402
SWIFT_OBJC_BRIDGING_HEADER = "./UnitTests/mParticle_iOS_SDKTests-Bridging-Header.h";
24122403
SWIFT_VERSION = 5.0;
24132404
TARGETED_DEVICE_FAMILY = "1,2,3";
2414-
TVOS_DEPLOYMENT_TARGET = 15.6;
24152405
};
24162406
name = Release;
24172407
};
@@ -2629,7 +2619,6 @@
26292619
CURRENT_PROJECT_VERSION = 1;
26302620
DEVELOPMENT_TEAM = DLD43Y3TRP;
26312621
INFOPLIST_FILE = ./UnitTests/Info.plist;
2632-
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
26332622
MARKETING_VERSION = 1.0;
26342623
PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.mParticle-Apple-SDKTests";
26352624
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2641,7 +2630,6 @@
26412630
SWIFT_OBJC_BRIDGING_HEADER = "./UnitTests/mParticle_iOS_SDKTests-Bridging-Header.h";
26422631
SWIFT_VERSION = 5.0;
26432632
TARGETED_DEVICE_FAMILY = "1,2,3";
2644-
TVOS_DEPLOYMENT_TARGET = 15.6;
26452633
};
26462634
name = Debug;
26472635
};
@@ -2654,7 +2642,6 @@
26542642
CURRENT_PROJECT_VERSION = 1;
26552643
DEVELOPMENT_TEAM = DLD43Y3TRP;
26562644
INFOPLIST_FILE = ./UnitTests/Info.plist;
2657-
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
26582645
MARKETING_VERSION = 1.0;
26592646
PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.mParticle-Apple-SDKTests";
26602647
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2666,7 +2653,6 @@
26662653
SWIFT_OBJC_BRIDGING_HEADER = "./UnitTests/mParticle_iOS_SDKTests-Bridging-Header.h";
26672654
SWIFT_VERSION = 5.0;
26682655
TARGETED_DEVICE_FAMILY = "1,2,3";
2669-
TVOS_DEPLOYMENT_TARGET = 15.6;
26702656
};
26712657
name = Release;
26722658
};

mParticle-Apple-SDK/Include/mParticle.h

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -754,57 +754,32 @@ Defaults to false. Prevents the eventsHost above from overwriting the alias endp
754754
#endif
755755

756756
/**
757-
DEPRECATED: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/application(_:open:sourceapplication:annotation:)
758-
Use a UIScene lifecycle, mParticle's handleURLContext: method, and scene(_:openURLContexts:) from UISceneDelegate instead.
759-
760757
Informs the mParticle SDK the app has been asked to open a resource identified by a URL.
761758
This method should be called only if proxiedAppDelegate is disabled.
762759
@param url The URL resource to open
763760
@param sourceApplication The bundle ID of the requesting app
764761
@param annotation A property list object supplied by the source app
765762
@see proxiedAppDelegate
766763
*/
767-
- (void)openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(nullable id)annotation DEPRECATED_MSG_ATTRIBUTE("iOS 27 will no longer support this protocol method");
764+
- (void)openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(nullable id)annotation;
768765

769766
/**
770-
DEPRECATED: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/application(_:open:sourceapplication:annotation:)
771-
Use a UIScene lifecycle, mParticle's handleURLContext: method, and scene(_:openURLContexts:) from UISceneDelegate instead.
772-
773767
Informs the mParticle SDK the app has been asked to open a resource identified by a URL.
774768
This method should be called only if proxiedAppDelegate is disabled. This method is only available for iOS 9 and above.
775769
@param url The URL resource to open
776770
@param options The dictionary of launch options
777771
@see proxiedAppDelegate
778772
*/
779-
- (void)openURL:(NSURL *)url options:(nullable NSDictionary *)options DEPRECATED_MSG_ATTRIBUTE("iOS 27 will no longer support this protocol method");
773+
- (void)openURL:(NSURL *)url options:(nullable NSDictionary *)options;
780774

781775
/**
782-
DEPRECATED: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/application(_:continue:restorationhandler:)
783-
Use UIScene lifecycle, mParticle's handleUserActivity: method, and scene(_:continue:) from UISceneDelegate instead.
784-
785776
Informs the mParticle SDK the app has been asked to open to continue an NSUserActivity.
786777
This method should be called only if proxiedAppDelegate is disabled. This method is only available for iOS 9 and above.
787778
@param userActivity The NSUserActivity that caused the app to be opened
788779
@param restorationHandler A block to execute if your app creates objects to perform the task.
789780
@see proxiedAppDelegate
790781
*/
791-
- (BOOL)continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(void(^ _Nonnull)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler DEPRECATED_MSG_ATTRIBUTE("iOS 27 will no longer support this protocol method");
792-
793-
/**
794-
Informs the mParticle SDK the app has been asked to open a resource identified by a URL.
795-
This method should be called only if proxiedAppDelegate is disabled. This method is only available for iOS 13 and above.
796-
@param urlContext The UIOpenURLContext provided by the SceneDelegate
797-
@see proxiedAppDelegate
798-
*/
799-
- (void)handleURLContext:(UIOpenURLContext *)urlContext NS_SWIFT_NAME(handleURLContext(_:)) API_AVAILABLE(ios(13.0));
800-
801-
/**
802-
Informs the mParticle SDK the app has been asked to open to continue an NSUserActivity.
803-
This method should be called only if proxiedAppDelegate is disabled.
804-
@param userActivity The NSUserActivity that caused the app to be opened
805-
@see proxiedAppDelegate
806-
*/
807-
- (void)handleUserActivity:(NSUserActivity *)userActivity NS_SWIFT_NAME(handleUserActivity(_:));
782+
- (BOOL)continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(void(^ _Nonnull)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler;
808783

809784
/**
810785
DEPRECATED: This method will permanently remove ALL MParticle data from the device, including MParticle UserDefaults and Database, it will also halt any further upload or download behavior that may be prepared

mParticle-Apple-SDK/Kits/MPKitConfiguration.mm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ - (instancetype)initWithDictionary:(NSDictionary *)configurationDictionary {
2323
return nil;
2424
}
2525

26-
NSJSONWritingOptions options = 0;
27-
if (@available(iOS 11.0, tvOS 11.0, *)) {
28-
options = NSJSONWritingSortedKeys;
29-
}
30-
NSData *ekConfigData = [NSJSONSerialization dataWithJSONObject:configurationDictionary options:options error:nil];
26+
NSData *ekConfigData = [NSJSONSerialization dataWithJSONObject:configurationDictionary options:0 error:nil];
3127
NSString *ekConfigString = [[NSString alloc] initWithData:ekConfigData encoding:NSUTF8StringEncoding];
3228
_configurationHash = @([[MPIHasher hashString:ekConfigString] intValue]);
3329

@@ -118,11 +114,16 @@ - (id)initWithCoder:(NSCoder *)coder {
118114
@try {
119115
configurationDictionary = [coder decodeObjectOfClass:[NSDictionary class] forKey:@"configurationDictionary"];
120116
}
117+
121118
@catch ( NSException *e) {
122119
configurationDictionary = nil;
123120
MPILogError(@"Exception decoding MPKitConfiguration Attributes: %@", [e reason]);
124121
}
125122

123+
@finally {
124+
self = [self initWithDictionary:configurationDictionary];
125+
}
126+
126127
self = [self initWithDictionary:configurationDictionary];
127128
if (!self) {
128129
return nil;

mParticle-Apple-SDK/mParticle.m

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -697,46 +697,6 @@ - (BOOL)continueUserActivity:(nonnull NSUserActivity *)userActivity restorationH
697697
return [self.appNotificationHandler continueUserActivity:userActivity restorationHandler:restorationHandler];
698698
}
699699

700-
- (void)handleURLContext:(UIOpenURLContext *)urlContext API_AVAILABLE(ios(13.0)){
701-
NSString *messageURL = [NSString stringWithFormat:@"Opening URLContext URL: %@", urlContext.URL];
702-
[logger debug:messageURL];
703-
NSString *messageSource = [NSString stringWithFormat:@"Source: %@", urlContext.options.sourceApplication ? urlContext.options.sourceApplication : @"unknown"];
704-
[logger debug:messageSource];
705-
NSString *messageAnnotation = [NSString stringWithFormat:@"Annotation: %@", urlContext.options.annotation];
706-
[logger debug:messageAnnotation];
707-
#if TARGET_OS_IOS == 1
708-
if (@available(iOS 14.5, *)) {
709-
NSString *messageEventAttribution = [NSString stringWithFormat:@"Event Attribution: %@", urlContext.options.eventAttribution];
710-
[logger debug:messageEventAttribution];
711-
}
712-
#endif
713-
NSString *messageOpenInPlace = [NSString stringWithFormat:@"Open in place: %@", urlContext.options.openInPlace ? @"True" : @"False"];
714-
[logger debug:messageOpenInPlace];
715-
716-
// Currently only one kit integration uses this dictionary for this key
717-
// https://github.com/mparticle-integrations/mparticle-apple-integration-flurry/blob/a0856e271aa9a63a6668805582395dea63f96af5/mParticle-Flurry/MPKitFlurry.m#L148C38-L148C85
718-
NSDictionary *options = @{@"UIApplicationOpenURLOptionsSourceApplicationKey": urlContext.options.sourceApplication};
719-
720-
[self.appNotificationHandler openURL:urlContext.URL options:options];
721-
}
722-
723-
- (void)handleUserActivity:(NSUserActivity *)userActivity {
724-
NSString *message = [NSString stringWithFormat:@"User Activity Received"];
725-
[logger debug:message];
726-
NSString *messageType = [NSString stringWithFormat:@"User Activity Type: %@", userActivity.activityType];
727-
[logger debug:messageType];
728-
NSString *messageTitle = [NSString stringWithFormat:@"User Activity Title: %@", userActivity.title];
729-
[logger debug:messageTitle];
730-
NSString *messageUserInfo = [NSString stringWithFormat:@"User Activity User Info: %@", userActivity.userInfo];
731-
[logger debug:messageUserInfo];
732-
if (userActivity.activityType == NSUserActivityTypeBrowsingWeb) {
733-
NSString *messageURL = [NSString stringWithFormat:@"Opening UserActivity URL: %@", userActivity.webpageURL];
734-
[logger debug:messageURL];
735-
}
736-
// When provided by the SceneDelegate NSUserActivity is not paired with a restorationHandler
737-
[self.appNotificationHandler continueUserActivity: userActivity restorationHandler:^(NSArray<id<UIUserActivityRestoring>> * _Nullable restorableObjects) {}];
738-
}
739-
740700
- (void)reset:(void (^)(void))completion {
741701
[executor executeOnMessage:^{
742702
[self.kitContainer flushSerializedKits];

0 commit comments

Comments
 (0)