Commit 40a8e46b authored by Jonathan Cichon's avatar Jonathan Cichon

tracking callbacks and Ref handling overwrite

parent 47f3a39d
......@@ -2,10 +2,10 @@ PODS:
- SDWebImage (4.3.3):
- SDWebImage/Core (= 4.3.3)
- SDWebImage/Core (4.3.3)
- Tickaroo2CoreEmbed (3.0.19):
- Tickaroo2CoreEmbed (3.0.20):
- SDWebImage (~> 4.0)
- TickarooBase (= 3.0.19)
- TickarooBase (3.0.19)
- TickarooBase (= 3.0.20)
- TickarooBase (3.0.20)
DEPENDENCIES:
- Tickaroo2CoreEmbed
......@@ -19,8 +19,8 @@ SPEC REPOS:
SPEC CHECKSUMS:
SDWebImage: de4d90b5bff3571eae7bd16202b1f43135409fa5
Tickaroo2CoreEmbed: 9f63cc321748f2b4e3e138ecea4df08a7ba10782
TickarooBase: 8fec30634d0522df07b48abe1e58b10f0a253c5d
Tickaroo2CoreEmbed: 694076dae0d6d8c3049d703185665922bb0fdf82
TickarooBase: 85f2f98dbf288e9f25767d87f9ed428f56f846d8
PODFILE CHECKSUM: 5d924e086c68ffe53ad7b87645dc899423482e52
......
......@@ -371,6 +371,7 @@
DB8AC74C1E93E3B70095CC9F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
......
......@@ -8,6 +8,8 @@
#import "AppDelegate.h"
#import <Tickaroo2CoreEmbed/T2EmbedManager.h>
#import <Tickaroo2CoreEmbed/TApiUrlRef.h>
#import <Tickaroo2CoreEmbed/TApiEvent.h>
#import "ViewController.h"
......@@ -22,6 +24,11 @@
_window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
_rootNavigation = [[UINavigationController alloc] initWithRootViewController:ViewController.new];
_rootNavigation.navigationBar.translucent = false;
UIImage *backImg = [UIImage imageNamed:@"BackIcon"];
_rootNavigation.navigationBar.backIndicatorImage = backImg;
_rootNavigation.navigationBar.backIndicatorTransitionMaskImage = backImg;
[_window setRootViewController:_rootNavigation];
[_window makeKeyAndVisible];
......@@ -79,7 +86,32 @@
}
- (BOOL)tickarooEmbed:(T2EmbedManager *)embed navigateToRef:(TApiAbstractRef *)ref {
return false;
if ([ref isKindOfClass:[TApiUrlRef class]]) {
TApiUrlRef *urlRef = (TApiUrlRef *)ref;
if ([urlRef.url hasPrefix:@"http"]) { // we want to handle http(s) urls ourself
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlRef.url] options:@{} completionHandler:nil]; // open this url in webbrowser
return true; // tell the SDK to ignore this ref
}
}
return false; // tell the SDK to use default behavior
}
/*
view and Event Tracking
*/
- (void)tickarooEmbed:(T2EmbedManager *)embed trackView:(NSString *)view identifier:(NSString *)identifier type:(T2ViewTrackingType)type userInfos:(NSDictionary *)userInfos {
NSLog(@"trackView: %@\nidentifier: %@\ntype: %@\nuserInfos:%@", view, identifier, type == T2ViewTrackingTypeLoad ? @"load" : @"appear", userInfos);
}
- (void)tickarooEmbed:(T2EmbedManager *)embed trackEvent:(NSString *)category action:(NSString *)action label:(NSString *)label value:(NSNumber *)value {
NSLog(@"trackEvent: %@\naction: %@\nlabel: %@\nvalue:%@", category, action, label, value);
}
- (void)tickarooEmbed:(T2EmbedManager *)embed didTrackEvent:(TApiEvent *)event {
NSLog(@"didTrackEvent: %@", event.toDictionary);
}
@end
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
......@@ -30,6 +40,16 @@
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
......@@ -59,6 +79,16 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "action_back@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "action_back@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -33,7 +33,9 @@
ref.tickerId = @"58e3b1ebf7596cf6cfae69c1";
ref.showMeta = false;
ref.showScoreboard = false;
UIViewController *cont = [T2EmbedManager viewControllerForRef:ref];
UIViewController<T2EmbedController> *cont = [T2EmbedManager viewControllerForRef:ref];
cont.title = @"myTitle";
cont.trackingUserInfos = @{@"myCustomTrackingId" : @"1234"};
[self.navigationController pushViewController:cont animated:YES];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment