Commit 41f1f7fa authored by Vahram Mirzoyan's avatar Vahram Mirzoyan

Updated for the new TickarooSDK

parent 3879f697
......@@ -2,5 +2,5 @@ source 'https://github.com/CocoaPods/Specs.git'
source 'git@git.tickaroo.com:pub/CocoaPods.git'
target 'TickarooEmbedSDKDemo' do
pod 'Tickaroo2CoreEmbed'
end
\ No newline at end of file
pod 'TickarooWriteSDK', '~> 3.0-beta'
end
PODS:
- SDWebImage (4.3.3):
- SDWebImage/Core (= 4.3.3)
- SDWebImage/Core (4.3.3)
- Tickaroo2CoreEmbed (3.0.22):
- SDWebImage (4.4.3):
- SDWebImage/Core (= 4.4.3)
- SDWebImage/Core (4.4.3)
- TickarooBase (3.0.46-beta)
- TickarooSDK (3.0.46-beta):
- SDWebImage (~> 4.0)
- TickarooBase (= 3.0.22)
- TickarooBase (3.0.22)
- TickarooBase (= 3.0.46-beta)
- TickarooWriteSDK (3.0.46-beta):
- TickarooSDK (= 3.0.46-beta)
DEPENDENCIES:
- Tickaroo2CoreEmbed
- TickarooWriteSDK (~> 3.0-beta)
SPEC REPOS:
"git@git.tickaroo.com:pub/CocoaPods.git":
- Tickaroo2CoreEmbed
- TickarooBase
https://github.com/CocoaPods/Specs.git:
- TickarooSDK
- TickarooWriteSDK
https://github.com/cocoapods/specs.git:
- SDWebImage
SPEC CHECKSUMS:
SDWebImage: de4d90b5bff3571eae7bd16202b1f43135409fa5
Tickaroo2CoreEmbed: 39cb2da15b49401034d0a288284385a17e8977af
TickarooBase: 88113a1508bf2a576697247c35c77b4b3d1b24f9
SDWebImage: c5594f1a19c48d526d321e548902b56b479cd508
TickarooBase: e1178850e3ef81e0176f26ff40d76caddb31aa4e
TickarooSDK: 53b28df6f688808a8761ecf937af63dd175065f6
TickarooWriteSDK: fc8ddf5f6c21bb99c1438d6f647b957647486dd9
PODFILE CHECKSUM: 5d924e086c68ffe53ad7b87645dc899423482e52
PODFILE CHECKSUM: 93278319193171ff307a60faf22eb3d7a0a81fde
COCOAPODS: 1.5.0
COCOAPODS: 1.5.3
......@@ -6,7 +6,7 @@ add
to the sources at the top of your Podfile. On Every appropriate Target add
pod 'Tickaroo2CoreEmbed'
pod 'TickarooSDK'
in your Podfile and do a pod install
......@@ -16,7 +16,7 @@ Example Podfile:
source 'git@git.tickaroo.com:pub/CocoaPods.git'
target 'Tickaroo2CoreEmbedTest' do
pod 'Tickaroo2CoreEmbed'`
pod 'TickarooSDK'
end
......@@ -24,7 +24,11 @@ Example Podfile:
add
#import <Tickaroo2CoreEmbed/T2EmbedManager.h>
#import <TickarooSDK/TickarooSDK.h>
or
@import TickarooSDK;
at the top of your `UIApplicationDelegate`.
......@@ -32,14 +36,14 @@ In
- (void)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
of your `UIApplicationDelegate` you need to call the initialation-code of the EmbedManager
of your `UIApplicationDelegate` you need to call the initialation-code of the TickarooSDK
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
[T2EmbedManager application:application didFinishLaunchingWithOptions:launchOptions
delegate:yourEmbedDelegate
[TickarooSDK application:application didFinishLaunchingWithOptions:launchOptions
delegate:yourTickarooSDKDelegate
options:@{
...
}
......@@ -50,9 +54,9 @@ of your `UIApplicationDelegate` you need to call the initialation-code of the Em
return YES;
}
your `T2EmbedManagerDelegate` (for Example the `UIApplicationDelegate`) needs to implement the following method
your `TickarooSDKDelegate` (for Example the `UIApplicationDelegate`) needs to implement the following method
- (UINavigationController *)rootNavigationControllerForTickarooEmbed:(T2EmbedManager *)embed;
- (UINavigationController *)rootNavigationControllerForTickarooSDK:(TickarooSDK *)tickarooSDK;
and return an `UINavigationController` Instance for the Embeded Ticker to work on.
......@@ -60,10 +64,11 @@ and return an `UINavigationController` Instance for the Embeded Ticker to work o
Example AppDelegate.m:
#import "AppDelegate.h"
#import <Tickaroo2CoreEmbed/T2EmbedManager.h>
#import "ViewController.h"
@import TickarooSDK;
@interface AppDelegate () <T2EmbedManagerDelegate>
@interface AppDelegate () <TickarooSDKDelegate>
@property (nonatomic) UINavigationController *rootNavigation;
@end
......@@ -77,21 +82,26 @@ Example AppDelegate.m:
[_window makeKeyAndVisible];
[T2EmbedManager application:application didFinishLaunchingWithOptions:launchOptions
delegate:self
options:@{T2EmbedOptionScoreboardImageMode : @(T2ScoreboardImageModeNone),
T2EmbedOptionRefreshBehavior :@(T2RefreshUser),
T2EmbedOptionApiClientID : @"111122223333444455556666",
T2EmbedOptionApiSchema : @"https",
T2EmbedOptionApiHost : @"staging.tickaroo.com",
}
styling:nil];
[TickarooSDK application:application didFinishLaunchingWithOptions:launchOptions
delegate:self
options:@{
TickarooOptionScoreboardImageMode : @(T2ScoreboardImageModeOwner),
TickarooOptionRefreshBehavior :@(T2RefreshUser),
TickarooOptionApiClientID : @"1234567890",
TickarooOptionApiHost : @"staging.tickaroo.com",
TickarooOptionLanguage : @"de"
}
styling:@{
TickarooStylingButtonCornerRadius : @(5),
TickarooStylingImageCornerRadius : @(5)
}];
return YES;
}
#pragma mark - T2EmbedManagerDelegate
- (UINavigationController *)rootNavigationControllerForTickarooEmbed:(T2EmbedManager *)embed {
return self.rootNavigation;
#pragma mark - TickarooSDKDelegate
- (UINavigationController *)rootNavigationControllerForTickarooSDK:(TickarooSDK *)tickarooSDK {
return _rootNavigationController;
}
@end
......@@ -100,11 +110,13 @@ Example AppDelegate.m:
Example for presenting a Ticker:
TApiTickerRef *ref = [[TApiTickerRef alloc] init];
ref.tickerId = @"557988b9e0fa059d66253a4d";
ref.tickerId = @"1234567890";
ref.showMeta = false;
ref.showScoreboard = false;
UIViewController *cont = [T2EmbedManager viewControllerForRef:ref];
[self.navigationController pushViewController:cont animated:YES];
[TickarooSDK requestViewControllerForRef:ref callback:^(UIViewController<TickarooSDKController> *vc) {
[self.navigationController pushViewController:vc animated:true];
}];
Options for `TApiTickerRef`:
......@@ -117,5 +129,4 @@ Options for `TApiTickerRef`:
* `show_lineup` Indicates whether to include the lineup in the screen, default true
* `show_meta` Indicates whether to include meta information in the screen, default true
* `show_event_meta` Indicates whether to include reporter information in events, default "off"
* `show_highlights` Indicates whether to include game highlights, default true
* `show_highlights` Indicates whether to include game highlights, default true
\ No newline at end of file
......@@ -133,7 +133,7 @@
DB8AC72B1E93E3B60095CC9F /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0820;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = "Tickaroo GmbH";
TargetAttributes = {
DB8AC7321E93E3B60095CC9F = {
......@@ -199,15 +199,19 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-TickarooEmbedSDKDemo/Pods-TickarooEmbedSDKDemo-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/Tickaroo2CoreEmbed/core-assets.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/Tickaroo2CoreEmbed/tickarooui-assets.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/Tickaroo2CoreEmbed/tik-iconpack.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TickarooSDK/core-assets.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TickarooSDK/tickarooui-assets.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TickarooSDK/tik-iconpack.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TickarooWriteSDK/write-assets.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TickarooWriteSDK/imagepicker-assets.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/core-assets.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/tickarooui-assets.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/tik-iconpack.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/write-assets.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/imagepicker-assets.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
......@@ -251,21 +255,30 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
......@@ -299,21 +312,30 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_BITCODE = NO;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
//
#import <Foundation/Foundation.h>
#import <Tickaroo2CoreEmbed/T2EmbedManager.h>
@import TickarooSDK;
@interface CustomerAdProvider : NSObject <T2AdProvider>
......
......@@ -7,12 +7,11 @@
//
#import <WebKit/WebKit.h>
#import <Tickaroo2CoreEmbed/TApiCustomerFrameworkAd.h>
#import <Tickaroo2CoreEmbed/TApiAdRow.h>
#import <objc/runtime.h>
#import "CustomerAdProvider.h"
@import TickarooSDK;
@interface MyAdView : UIView <T2AdView>
@property (nonatomic, copy) void (^loadCompletionCallback)(UIView<T2AdView> *);
......@@ -74,7 +73,7 @@ static void * kTApiCustomerFrameworkAd_AssociatedObject;
+ (void)load {
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
if (version.majorVersion >= 9) {
[T2EmbedManager registerProvider:CustomerAdProvider.new forAdType:[TApiCustomerFrameworkAd class]];
[TickarooSDK registerProvider:CustomerAdProvider.new forAdType:[TApiCustomerFrameworkAd class]];
}
}
......
......@@ -16,6 +16,12 @@
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Post a video</string>
<key>NSCameraUsageDescription</key>
<string>Access camera</string>
<key>NSMicrophoneUsageDescription</key>
<string>Record sound</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
......
......@@ -7,8 +7,8 @@
//
#import "ViewController.h"
#import <Tickaroo2CoreEmbed/T2EmbedManager.h>
#import <Tickaroo2CoreEmbed/TApiTickerRef.h>
@import TickarooSDK;
@interface ViewController ()
......@@ -18,33 +18,63 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = UIColor.grayColor;
UIButton *button = [[UIButton alloc] initWithFrame:(CGRect) {
.origin = {(self.view.frame.size.width-200)/2, (self.view.frame.size.height-40)/2},
.size = {200, 40},
}];
UIButton *tickerButton = UIButton.new;
[tickerButton setTitle:@"Soccer ticker" forState:UIControlStateNormal];
[tickerButton addTarget:self action:@selector(showSoccer) forControlEvents:UIControlEventTouchUpInside];
UIButton *writeButton = UIButton.new;
[writeButton setTitle:@"News ticker" forState:UIControlStateNormal];
[writeButton addTarget:self action:@selector(showNews) forControlEvents:UIControlEventTouchUpInside];
[button setAttributedTitle:[[NSAttributedString alloc] initWithString:@"embeded Ticker →" attributes:@{NSForegroundColorAttributeName : [UIColor whiteColor], NSFontAttributeName : [UIFont systemFontOfSize:40]}] forState:UIControlStateNormal];
button.titleLabel.adjustsFontSizeToFitWidth = YES;
button.titleLabel.minimumScaleFactor = 0.5;
UIButton *videoButton = UIButton.new;
[videoButton setTitle:@"Video" forState:UIControlStateNormal];
[videoButton addTarget:self action:@selector(showVideo) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];
[button addTarget:self action:@selector(goToTicker) forControlEvents:UIControlEventTouchUpInside];
UIStackView *stackView = [[UIStackView alloc] initWithArrangedSubviews:@[tickerButton, writeButton, videoButton]];
stackView.axis = UILayoutConstraintAxisVertical;
stackView.spacing = 10;
stackView.translatesAutoresizingMaskIntoConstraints = false;
[self.view addSubview:stackView];
[stackView.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor].active = true;
[stackView.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor].active = true;
}
- (void)goToTicker {
- (void)showSoccer {
TApiTickerRef *ref = [[TApiTickerRef alloc] init];
ref.tickerId = @"58e3b1ebf7596cf6cfae69c1";
ref.tickerId = @"5c1358cd221cc0cda54d91b9";
ref.showMeta = false;
ref.showScoreboard = true;
ref.limit = 10;
[TickarooSDK requestViewControllerForRef:ref callback:^(UIViewController<TickarooSDKController> *vc) {
vc.trackingUserInfos = @{@"trackingID": @"1234"};
[self.navigationController pushViewController:vc animated:true];
}];
}
- (void)showNews {
TApiTickerRef *ref = [[TApiTickerRef alloc] init];
ref.tickerId = @"58e3b1ebf7596cf6cfae69c1";
ref.showMeta = false;
ref.showScoreboard = true;
ref.limit = 10;
UIViewController<T2EmbedController> *cont = [T2EmbedManager viewControllerForRef:ref];
cont.title = @"myTitle";
cont.trackingUserInfos = @{@"myCustomTrackingId" : @"1234"};
[self.navigationController pushViewController:cont animated:YES];
[TickarooSDK requestViewControllerForRef:ref callback:^(UIViewController<TickarooSDKController> *vc) {
vc.trackingUserInfos = @{@"trackingID": @"1234"};
[self.navigationController pushViewController:vc animated:true];
}];
}
- (void)showVideo {
TApiTickerWriteVideoClipRef *videoRef = TApiTickerWriteVideoClipRef.new;
videoRef.localId = @"00jpnpn53l4ttugsf8kg4f";
[TickarooSDK requestViewControllerForRef:videoRef callback:^(UIViewController<TickarooSDKController> *vc) {
[self presentViewController:vc animated:YES completion:nil];
}];
}
@end
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