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.
We recommend using Cocoapods to quickly and easily add Heap:
- Install Cocoapods by running
sudo gem install cocoapods
. - Create a file in your Xcode project directory called
Podfile
. - Add the following line to your Podfile:
pod 'Heap'
-
Run
pod install
within your Xcode project directory. -
Initialize Heap with your app ID. We recommend doing this in
applicationDidFinishLaunching:
orapplication:didFinishLaunchingWithOptions:
in your Application delegate as follows:import Heap func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { Heap.initialize("YOUR_APP_ID") /* Other launch code goes here */ return true }
#import <Heap/Heap.h> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [Heap initialize:@"YOUR_APP_ID"]; /* Other launch code goes here */ return YES; }
-
Make sure you open the file with the extension .xcworkspace
Or you can install Heap manually:
- Download the Heap iOS library.
- Unzip the downloaded file and drag
Heap.xcframework
into your XCode project. Make sure to select Copy items if needed and add the framework to your app targets. - Click on the project (blue project icon), and select "General".
- Within General, find "Heap.xcframework" in the "Frameworks, Libraries, and Embedded Content" section and change it to from "Do Not Embed" to "Embed & Sign".
- Initialize Heap with your app ID, as illustrated in the code snippet above.
Starting in Heap 8.0.0, the library is now bundled as an XCFramework rather than univeral static library. When using Cocoapods, updating
the pod will automatically switch to the new format. When installing manually, you will want to remove Heap.h
and libHeap.a
from your project and follow the installation instructions above.
If you were using Heap from Objective-C, you will simply need to replace #import "Heap.h"
statements with #import <Heap/Heap.h>
.
If you were using Heap from Swift, you can either replace the #import "Heap.h"
statement in your bridging header with #import <Heap/Heap.h>
or remove the statement from your briding header completely and use import Heap
directly from Swift as shown in the installation instructions.
Heap should work with standalone iMessage apps if you override didBecomeActive
:
func didBecomeActive(with conversation: MSConversation) {
Heap.initialize("YOUR_APP_ID");
}
Having trouble with iOS installation? Here are solutions for common problems.