Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provides SPM Support for Appetitive Integration. #19

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

TheiOSDude
Copy link

Summary

Adds Package.swift file for SPM support
Fixes from: viewController being nil.

Testing Plan

Integration with SPM

@TheiOSDude
Copy link
Author

@peterjenkins Gymshark required this integration via SPM. Hope this helps others. Thanks @bolshedvorsky for the work.

…ns/mparticle-apple-integration-apptentive into mparticle-integrations-development

# Conflicts:
#	mParticle-Apptentive/MPKitApptentive.m
@@ -270,10 +268,14 @@ - (nonnull MPKitExecStatus *)logBaseEvent:(nonnull MPBaseEvent *)event {

- (MPKitExecStatus *)routeEvent:(MPEvent *)event {
NSDictionary *eventValues = event.customAttributes;

UIViewController * rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
Copy link
Contributor

@frankus frankus Feb 9, 2023

Choose a reason for hiding this comment

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

I might be missing something, but this case should already be handled by the Apptentive SDK.

Passing nil results in a nil presentingViewController property on the InteractionPresenter instance (see https://github.com/apptentive/apptentive-kit-ios/blob/97ba45ba650f742be956a5e33fc1c4f31a626574/Sources/ApptentiveKit/Interactions/InteractionPresenter.swift#L168), which will walk up the view controller stack of the application's keyWindow. It also handles the (surprisingly common) case where an interaction tries to present on a view controller that is being dismissed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants