Heap is a modern take on analytics. There's no need to ship event tracking code, no need to wait days or weeks for data to accumulate, no need to muddle your codebase, and no need to fumble with rigid reports.
For the first time, meaningful product questions can be answered just as soon as they're asked.
See CHANGELOG.md
for what's new.
For this alpha release, Heap.xcframework and Heap_SwiftUI.xcframework need to be installed from Swift Package Manager.
- Use Swift Package Manager to add
https://github.com/heap/heap-ios-sdk.git
version9.0.0-alpha.2
to your app project. - Use Swift Package Manager to add
https://github.com/heap/heap-swiftui-sdk.git
version0.0.0-alpha.4
to your app project. - Initialize Heap with your app ID using
Heap.initializeForSwiftUI("YOUR_APP_ID")
If targetting iOS 14 and above, you can initialize Heap within an app delegate:
@main
struct MyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
...
}
}
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
Heap.initializeForSwiftUI("YOUR_APP_ID")
return true
}
}
The Event Visualizer can also be registered though the process outlined at https://developers.heap.io/docs/ios#step-1-register-the-url-type.
If you’re using an App as your main entry point, you will need to use the
onOpenURL
modifier:
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(model)
.onOpenURL { url in
Heap.handleOpen(url, options: [:])
}
}
}