-
Notifications
You must be signed in to change notification settings - Fork 16
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
MBX-3168: IDFA Example sample #450
Merged
+123
−35
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5825a9f
MBX-0000: Example - Fix CoreData warnings through first app installation
justSmK d3ea02e
MBX-3168: Example - Add AppDelegate IDFA request sample
justSmK 6bd4be9
MBX-0000: Fix ChooseInAppMessagesDelegate shared
justSmK 905e997
MBX-3168: SceneDelegate LifeCycle real example
justSmK af01459
MBX-3168: AppDelegate LifeCycle real example
justSmK c6ba678
MBX-3168: Revert project to default state
justSmK 7df3a17
MBX-0000: Remove unnecessary Scene Configuration funсtion since every…
justSmK 9ab27b7
MBX-3168: Remove `if #available` from IDFA Sample
justSmK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// AppDelegate_IDFA.swift | ||
// Example | ||
// | ||
// Created by Sergei Semko on 10/7/24. | ||
// Copyright © 2024 Mindbox. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import Mindbox | ||
import AppTrackingTransparency | ||
|
||
// This is only one use case. It is necessary to adapt the approach to your specific use case. | ||
|
||
@main | ||
class AppDelegate_IDFA: MindboxAppDelegate { | ||
|
||
//https://developers.mindbox.ru/docs/ios-sdk-initialization | ||
override func application( | ||
_ application: UIApplication, | ||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | ||
) -> Bool { | ||
super.application(application, didFinishLaunchingWithOptions: launchOptions) | ||
|
||
if ATTrackingManager.trackingAuthorizationStatus != .notDetermined { | ||
initializeMindbox() | ||
} | ||
|
||
// ... | ||
return true | ||
} | ||
|
||
// If you're using scenes (iOS 13.0+), UIKit will not call this method. Use `sceneDidBecomeActive(_:)` instead. | ||
override func applicationDidBecomeActive(_ application: UIApplication) { | ||
if ATTrackingManager.trackingAuthorizationStatus == .notDetermined { | ||
DispatchQueue.main.async { | ||
ATTrackingManager.requestTrackingAuthorization { status in | ||
self.initializeMindbox() | ||
} | ||
} | ||
} | ||
} | ||
|
||
func initializeMindbox() { | ||
do { | ||
// To run the application on a physical device you need to change the endpoint | ||
// You should also change the application bundle ID in all targets, more details in the readme | ||
// You can still run the application on the simulator to see In-Apps | ||
let mindboxSdkConfig = try MBConfiguration( | ||
endpoint: "Mpush-test.ReleaseExample.IosApp", | ||
domain: "api.mindbox.ru", | ||
subscribeCustomerIfCreated: true, | ||
shouldCreateCustomer: true | ||
) | ||
Mindbox.shared.initialization(configuration: mindboxSdkConfig) | ||
} catch { | ||
print(error.localizedDescription) | ||
} | ||
} | ||
|
||
// ... | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что за рефактор?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давно про это тебе рассказывал. Там CoreData под капотом ругается на первый запуск у всех. И выводит это в std. Мешает читать консоль. В нашем случае решил обработать ситуацию и пофиксить, чтобы и у клиентов вопросов меньше было, и нам самим удобно было
Что выводит