forked from mirrors/linphone-iphone
InAppProducts: integrating UI
This commit is contained in:
parent
1d77b5bc46
commit
0e9eafb0af
17 changed files with 446 additions and 33 deletions
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatRoomViewController">
|
||||
|
|
@ -248,14 +249,11 @@
|
|||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<gestureRecognizers/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
</view>
|
||||
<tableViewController autoresizesArchivedViewToFullSize="NO" id="29" userLabel="tableController" customClass="ChatRoomTableViewController">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
|
||||
<nil key="simulatedTopBarMetrics"/>
|
||||
<nil key="simulatedBottomBarMetrics"/>
|
||||
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
|
||||
<nil key="simulatedDestinationMetrics"/>
|
||||
<connections>
|
||||
<outlet property="view" destination="8" id="33"/>
|
||||
</connections>
|
||||
|
|
@ -281,4 +279,9 @@
|
|||
<image name="chat_send_over.png" width="117" height="115"/>
|
||||
<image name="toolsbar_background.png" width="5" height="88"/>
|
||||
</resources>
|
||||
</document>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination" type="retina4"/>
|
||||
</simulatedMetricsContainer>
|
||||
</document>
|
||||
|
|
|
|||
27
Classes/InAppProductsCell.h
Normal file
27
Classes/InAppProductsCell.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
//
|
||||
// InAppProductsCell.h
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 15/04/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "UITransparentTVCell.h"
|
||||
|
||||
|
||||
@interface InAppProductsCell : UITransparentTVCell {
|
||||
|
||||
}
|
||||
@property (retain, nonatomic) IBOutlet UILabel *ptitle;
|
||||
@property (retain, nonatomic) IBOutlet UILabel *pdescription;
|
||||
@property (retain, nonatomic) IBOutlet UILabel *pprice;
|
||||
@property (retain, nonatomic) IBOutlet UISwitch *ppurchased;
|
||||
@property (nonatomic) BOOL isMaximized;
|
||||
|
||||
- (id)initWithIdentifier:(NSString*)identifier;
|
||||
|
||||
+ (CGFloat)getHeight:(BOOL)maximized;
|
||||
|
||||
@end
|
||||
52
Classes/InAppProductsCell.m
Normal file
52
Classes/InAppProductsCell.m
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
//
|
||||
// InAppProductsCell.m
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 15/04/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import "InAppProductsCell.h"
|
||||
|
||||
@implementation InAppProductsCell
|
||||
|
||||
- (void)setIsMaximized:(BOOL)isMaximized {
|
||||
_isMaximized = isMaximized;
|
||||
|
||||
//show the BUY button only when not maximized
|
||||
|
||||
self.frame = CGRectMake(self.frame.origin.x,
|
||||
self.frame.origin.y,
|
||||
self.frame.size.width,
|
||||
[InAppProductsCell getHeight:isMaximized]);
|
||||
}
|
||||
|
||||
- (id)initWithIdentifier:(NSString*)identifier {
|
||||
if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) {
|
||||
NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"InAppProductsCell"
|
||||
owner:self
|
||||
options:nil];
|
||||
if ([arrayOfViews count] >= 1) {
|
||||
[self.contentView addSubview:[arrayOfViews objectAtIndex:0]];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_ptitle release];
|
||||
[_pdescription release];
|
||||
[_pprice release];
|
||||
[_ppurchased release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"%@ (%@): %@", _ptitle.text, _pprice.text, _pdescription.text];
|
||||
}
|
||||
|
||||
+ (CGFloat)getHeight:(BOOL)maximized {
|
||||
return maximized ? 120 : 44;
|
||||
}
|
||||
|
||||
@end
|
||||
60
Classes/InAppProductsCell.xib
Normal file
60
Classes/InAppProductsCell.xib
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="InAppProductsCell">
|
||||
<connections>
|
||||
<outlet property="pdescription" destination="4s8-UV-skT" id="gYv-YR-7Kx"/>
|
||||
<outlet property="pprice" destination="jzs-nJ-jrK" id="UBe-qg-Gmj"/>
|
||||
<outlet property="ppurchased" destination="Bcv-Vz-Tq1" id="EB5-Ic-nCq"/>
|
||||
<outlet property="ptitle" destination="Np2-5N-fTR" id="X3D-TQ-R8R"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="Jvg-Ga-qnD">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="title" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" id="Np2-5N-fTR" userLabel="ptitle">
|
||||
<rect key="frame" x="0.0" y="0.0" width="55" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" tag="1" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="description..." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" id="4s8-UV-skT" userLabel="pdescription">
|
||||
<rect key="frame" x="119" y="0.0" width="136" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" tag="2" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="$0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" id="jzs-nJ-jrK" userLabel="pprice">
|
||||
<rect key="frame" x="63" y="0.0" width="48" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="Bcv-Vz-Tq1" userLabel="ppurchased">
|
||||
<rect key="frame" x="263" y="6" width="51" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</switch>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<nil key="simulatedTopBarMetrics"/>
|
||||
<nil key="simulatedBottomBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="148" y="589"/>
|
||||
</view>
|
||||
</objects>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination" type="retina4"/>
|
||||
</simulatedMetricsContainer>
|
||||
</document>
|
||||
|
|
@ -20,8 +20,15 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import <StoreKit/StoreKit.h>
|
||||
|
||||
extern NSString *const kInAppProductsReady;
|
||||
|
||||
@interface InAppProductsManager : NSObject <SKProductsRequestDelegate, SKPaymentTransactionObserver> {
|
||||
NSArray *inAppProducts;
|
||||
|
||||
}
|
||||
|
||||
@property (readonly) NSArray *inAppProducts;
|
||||
|
||||
- (void)loadProducts;
|
||||
- (BOOL)isPurchased:(SKProduct*)product;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -20,14 +20,16 @@
|
|||
#import "InAppProductsManager.h"
|
||||
#import "Utils.h"
|
||||
|
||||
NSString *const kInAppProductsReady = @"InAppProductsReady";
|
||||
|
||||
@implementation InAppProductsManager {
|
||||
bool ready;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
if ((self = [super init]) != nil) {
|
||||
[self loadProducts];
|
||||
ready = false;
|
||||
[self loadProducts];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
@ -36,31 +38,46 @@
|
|||
if (! [SKPaymentQueue canMakePayments]) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSURL *url = [[NSBundle mainBundle] URLForResource:@"in_app_products"
|
||||
withExtension:@"plist"];
|
||||
|
||||
inAppProducts = [NSArray arrayWithContentsOfURL:url];
|
||||
//TODO: move this list elsewhere
|
||||
NSArray * list = [[NSArray alloc] initWithArray:@[@"test.tunnel"]];
|
||||
|
||||
SKProductsRequest *productsRequest = [[SKProductsRequest alloc]
|
||||
initWithProductIdentifiers:[NSSet setWithArray:inAppProducts]];
|
||||
initWithProductIdentifiers:[NSSet setWithArray:list]];
|
||||
productsRequest.delegate = self;
|
||||
[productsRequest start];
|
||||
}
|
||||
|
||||
- (void)productsRequest:(SKProductsRequest *)request
|
||||
didReceiveResponse:(SKProductsResponse *)response {
|
||||
inAppProducts = response.products;
|
||||
LOGI(@"Found %lu products purchasable", inAppProducts.count);
|
||||
_inAppProducts = [response.products retain];
|
||||
LOGI(@"Found %lu products purchasable", (unsigned long)_inAppProducts.count);
|
||||
|
||||
for (NSString *invalidIdentifier in response.invalidProductIdentifiers) {
|
||||
LOGE(@"Product Identifier with invalid ID %@", invalidIdentifier);
|
||||
}
|
||||
ready = true;
|
||||
|
||||
NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
_inAppProducts, @"products",
|
||||
nil];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^(void){
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kInAppProductsReady object:self userInfo:dict];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
|
||||
|
||||
}
|
||||
|
||||
- (BOOL)isPurchased:(SKProduct*)product {
|
||||
for (SKProduct *prod in _inAppProducts) {
|
||||
if (prod == product) {
|
||||
LOGE(@"Is %@ bought? assuming NO", product.localizedTitle);
|
||||
return false; //todo
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@end
|
||||
13
Classes/InAppProductsTableViewController.h
Normal file
13
Classes/InAppProductsTableViewController.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
// InAppProductsTableViewController.h
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 16/04/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface InAppProductsTableViewController : UITableViewController
|
||||
|
||||
@end
|
||||
70
Classes/InAppProductsTableViewController.m
Normal file
70
Classes/InAppProductsTableViewController.m
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
//
|
||||
// InAppProductsTableViewController.m
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 16/04/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import "InAppProductsTableViewController.h"
|
||||
#import "InAppProductsCell.h"
|
||||
#import "InAppProductsManager.h"
|
||||
#import "LinphoneManager.h"
|
||||
|
||||
@implementation InAppProductsTableViewController {
|
||||
InAppProductsManager *iapm;
|
||||
NSInteger currentExpanded;
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
iapm = [[LinphoneManager instance] iapManager];
|
||||
|
||||
[iapm loadProducts];
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return [iapm inAppProducts].count;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
static NSString *kCellId = @"InAppProductsCell";
|
||||
InAppProductsCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId];
|
||||
if (cell == nil) {
|
||||
cell = [[[InAppProductsCell alloc] initWithIdentifier:kCellId] autorelease];
|
||||
}
|
||||
SKProduct *prod = [[[[LinphoneManager instance] iapManager] inAppProducts] objectAtIndex:indexPath.row];
|
||||
[cell.ptitle setText: [prod localizedTitle]];
|
||||
[cell.pdescription setText: [prod localizedDescription]];
|
||||
[cell.pprice setText: [NSString stringWithFormat:@"%@", [prod price]]];
|
||||
[cell.ppurchased setEnabled: [iapm isPurchased:prod]];
|
||||
cell.isMaximized = (currentExpanded == indexPath.row);
|
||||
|
||||
LOGI(@"One more: %@", cell);
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if(currentExpanded == indexPath.row) {
|
||||
currentExpanded = -1;
|
||||
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
|
||||
return;
|
||||
} else if(currentExpanded >= 0) {
|
||||
NSIndexPath *previousPath = [NSIndexPath indexPathForRow:currentExpanded inSection:0];
|
||||
currentExpanded = indexPath.row;
|
||||
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:previousPath] withRowAnimation:UITableViewRowAnimationFade];
|
||||
}
|
||||
currentExpanded = indexPath.row;
|
||||
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return [InAppProductsCell getHeight:(currentExpanded == indexPath.row)];
|
||||
}
|
||||
|
||||
@end
|
||||
18
Classes/InAppProductsViewController.h
Normal file
18
Classes/InAppProductsViewController.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// InAppProductsViewController.h
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 15/04/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "UICompositeViewController.h"
|
||||
#import "InAppProductsTableViewController.h"
|
||||
|
||||
@interface InAppProductsViewController : UIViewController<UICompositeViewDelegate> {
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet InAppProductsTableViewController* tableController;
|
||||
|
||||
@end
|
||||
70
Classes/InAppProductsViewController.m
Normal file
70
Classes/InAppProductsViewController.m
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
//
|
||||
// InAppProductsViewController.m
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 15/04/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import "InAppProductsViewController.h"
|
||||
#import "InAppProductsCell.h"
|
||||
|
||||
@implementation InAppProductsViewController
|
||||
|
||||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
return [super initWithNibName:@"InAppProductsViewController" bundle:[NSBundle mainBundle]];
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
[_tableController release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark - ViewController Functions
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self
|
||||
// selector:@selector(textReceivedEvent:)
|
||||
// name:kLinphoneTextReceived
|
||||
// object:nil];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[super viewWillDisappear:animated];
|
||||
|
||||
// [[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
// name:kLinphoneTextReceived
|
||||
// object:nil];
|
||||
}
|
||||
|
||||
#pragma mark - UICompositeViewDelegate Functions
|
||||
|
||||
static UICompositeViewDescription *compositeDescription = nil;
|
||||
|
||||
+ (UICompositeViewDescription *)compositeViewDescription {
|
||||
if(compositeDescription == nil) {
|
||||
compositeDescription = [[UICompositeViewDescription alloc] init:@"InAppProducts"
|
||||
content:@"InAppProductsViewController"
|
||||
stateBar:nil
|
||||
stateBarEnabled:false
|
||||
tabBar: @"UIMainBar"
|
||||
tabBarEnabled:true
|
||||
fullscreen:false
|
||||
landscapeMode:[LinphoneManager runningOnIpad]
|
||||
portraitMode:true];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
||||
@end
|
||||
48
Classes/InAppProductsViewController.xib
Normal file
48
Classes/InAppProductsViewController.xib
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="InAppProductsViewController">
|
||||
<connections>
|
||||
<outlet property="tableController" destination="FRQ-Fw-iZ8" id="HVZ-37-Tau"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="460"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="fwu-cz-Gse" userLabel="productsTable">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="460"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="FRQ-Fw-iZ8" id="uQQ-fT-hHp"/>
|
||||
<outlet property="delegate" destination="FRQ-Fw-iZ8" id="2Dx-aQ-XVB"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="517" y="-365"/>
|
||||
</view>
|
||||
<tableViewController extendedLayoutIncludesOpaqueBars="YES" id="FRQ-Fw-iZ8" userLabel="tableController" customClass="InAppProductsTableViewController">
|
||||
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<size key="freeformSize" width="320" height="460"/>
|
||||
<connections>
|
||||
<outlet property="view" destination="fwu-cz-Gse" id="qar-Rf-89v"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="139" y="-365"/>
|
||||
</tableViewController>
|
||||
</objects>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination" type="retina4"/>
|
||||
</simulatedMetricsContainer>
|
||||
</document>
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
#import <QuartzCore/QuartzCore.h>
|
||||
#import <AudioToolbox/AudioServices.h>
|
||||
|
||||
#import "InAppProductsViewController.h"
|
||||
#import "LinphoneAppDelegate.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "Utils.h"
|
||||
|
|
@ -403,7 +404,6 @@ static RootViewManager* rootViewManagerInstance = nil;
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)startUp {
|
||||
LinphoneCore* core = nil;
|
||||
@try {
|
||||
|
|
@ -419,7 +419,8 @@ static RootViewManager* rootViewManagerInstance = nil;
|
|||
// Change to default view
|
||||
const MSList *list = linphone_core_get_proxy_config_list(core);
|
||||
if(list != NULL || ([lm lpConfigBoolForKey:@"hide_wizard_preference"] == true) || lm.isTesting) {
|
||||
[self changeCurrentView: [DialerViewController compositeViewDescription]];
|
||||
[self changeCurrentView: [InAppProductsViewController compositeViewDescription]];
|
||||
|
||||
} else {
|
||||
WizardViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[WizardViewController compositeViewDescription]], WizardViewController);
|
||||
if(controller != nil) {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#import "PhoneMainView.h"
|
||||
#import "UILinphone.h"
|
||||
#import "UACellBackgroundView.h"
|
||||
#import "InAppProductsViewController.h"
|
||||
|
||||
#import "DCRoundSwitch.h"
|
||||
|
||||
|
|
@ -466,6 +467,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
selector:@selector(appSettingChanged:)
|
||||
name:kIASKAppSettingChanged
|
||||
object:nil];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -603,7 +605,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[hiddenKeys addObject:@"send_logs_button"];
|
||||
[hiddenKeys addObject:@"reset_logs_button"];
|
||||
}
|
||||
|
||||
|
||||
[hiddenKeys addObject:@"playback_gain_preference"];
|
||||
[hiddenKeys addObject:@"microphone_gain_preference"];
|
||||
|
||||
|
|
@ -770,6 +772,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
[self emailAttachment:[NSData dataWithContentsOfFile:[NSString stringWithUTF8String:filepath]] mimeType:mimeType name:filename];
|
||||
ms_free(filepath);
|
||||
} else if([key isEqual:@"in_app_products_button"]) {
|
||||
[[PhoneMainView instance] changeCurrentView:[InAppProductsViewController compositeViewDescription] push:TRUE];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -242,6 +242,14 @@
|
|||
<key>Type</key>
|
||||
<string>PSChildPaneSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Key</key>
|
||||
<string>in_app_products_button</string>
|
||||
<key>Title</key>
|
||||
<string>Extra features</string>
|
||||
<key>Type</key>
|
||||
<string>IASKButtonSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Title</key>
|
||||
<string></string>
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array>
|
||||
<string>test.tunnel</string>
|
||||
</array>
|
||||
</plist>
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Linphone</string>
|
||||
<string>LinphoneTest</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIcons~ipad</key>
|
||||
|
|
|
|||
|
|
@ -112,6 +112,11 @@
|
|||
57F005CA15EE2D9200914747 /* linphonerc-factory~ipad in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C715EE2D9200914747 /* linphonerc-factory~ipad */; };
|
||||
631C4FB119D2A8F2004BFE77 /* UIDigitButtonLongPlus.m in Sources */ = {isa = PBXBuildFile; fileRef = 631C4FB019D2A8F2004BFE77 /* UIDigitButtonLongPlus.m */; };
|
||||
631C4FB719D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m in Sources */ = {isa = PBXBuildFile; fileRef = 631C4FB619D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m */; };
|
||||
6359DE7F1ADEB54200EA15C0 /* InAppProductsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6359DE7D1ADEB54200EA15C0 /* InAppProductsViewController.m */; };
|
||||
6359DE801ADEB54200EA15C0 /* InAppProductsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6359DE7E1ADEB54200EA15C0 /* InAppProductsViewController.xib */; };
|
||||
6359DE841ADEB64100EA15C0 /* InAppProductsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6359DE821ADEB64100EA15C0 /* InAppProductsCell.m */; };
|
||||
6359DE851ADEB64100EA15C0 /* InAppProductsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6359DE831ADEB64100EA15C0 /* InAppProductsCell.xib */; };
|
||||
6359DE8B1ADF9EB900EA15C0 /* InAppProductsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6359DE8A1ADF9EB900EA15C0 /* InAppProductsTableViewController.m */; };
|
||||
636316D11A1DEBCB0009B839 /* AboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 636316D31A1DEBCB0009B839 /* AboutViewController.xib */; };
|
||||
636316D41A1DEC650009B839 /* SettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 636316D61A1DEC650009B839 /* SettingsViewController.xib */; };
|
||||
636316D91A1DECC90009B839 /* PhoneMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 636316D71A1DECC90009B839 /* PhoneMainView.xib */; };
|
||||
|
|
@ -123,7 +128,6 @@
|
|||
639CEB091A1DF4FA004DE38F /* UIChatCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 639CEB0B1A1DF4FA004DE38F /* UIChatCell.xib */; };
|
||||
63CD4B4F1A5AAC8C00B84282 /* DTAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63CD4B4E1A5AAC8C00B84282 /* DTAlertView.m */; };
|
||||
63E59A3A1ADE6A0100646FB3 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63E59A391ADE6A0100646FB3 /* StoreKit.framework */; };
|
||||
63E59A3C1ADE6E5C00646FB3 /* in_app_products.plist in Resources */ = {isa = PBXBuildFile; fileRef = 63E59A3B1ADE6E5C00646FB3 /* in_app_products.plist */; };
|
||||
63E59A3F1ADE70D900646FB3 /* InAppProductsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E59A3E1ADE70D900646FB3 /* InAppProductsManager.m */; };
|
||||
63FB30351A680E73008CA393 /* UIRoundedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63FB30341A680E73008CA393 /* UIRoundedImageView.m */; };
|
||||
70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */ = {isa = PBXBuildFile; fileRef = 70571E1913FABCB000CDD3C2 /* rootca.pem */; };
|
||||
|
|
@ -1023,6 +1027,14 @@
|
|||
631C4FB519D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDigitButtonLongVoiceMail.h; sourceTree = "<group>"; };
|
||||
631C4FB619D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDigitButtonLongVoiceMail.m; sourceTree = "<group>"; };
|
||||
633E388219FFB0F400936D1C /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
6359DE7C1ADEB54200EA15C0 /* InAppProductsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InAppProductsViewController.h; sourceTree = "<group>"; };
|
||||
6359DE7D1ADEB54200EA15C0 /* InAppProductsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InAppProductsViewController.m; sourceTree = "<group>"; };
|
||||
6359DE7E1ADEB54200EA15C0 /* InAppProductsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InAppProductsViewController.xib; sourceTree = "<group>"; };
|
||||
6359DE811ADEB64100EA15C0 /* InAppProductsCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InAppProductsCell.h; sourceTree = "<group>"; };
|
||||
6359DE821ADEB64100EA15C0 /* InAppProductsCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InAppProductsCell.m; sourceTree = "<group>"; };
|
||||
6359DE831ADEB64100EA15C0 /* InAppProductsCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InAppProductsCell.xib; sourceTree = "<group>"; };
|
||||
6359DE891ADF9EB900EA15C0 /* InAppProductsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InAppProductsTableViewController.h; sourceTree = "<group>"; };
|
||||
6359DE8A1ADF9EB900EA15C0 /* InAppProductsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InAppProductsTableViewController.m; sourceTree = "<group>"; };
|
||||
636316D21A1DEBCB0009B839 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AboutViewController.xib; sourceTree = "<group>"; };
|
||||
636316D51A1DEC650009B839 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SettingsViewController.xib; sourceTree = "<group>"; };
|
||||
636316D81A1DECC90009B839 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PhoneMainView.xib; sourceTree = "<group>"; };
|
||||
|
|
@ -1040,7 +1052,6 @@
|
|||
63CD4B4D1A5AAC8C00B84282 /* DTAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTAlertView.h; sourceTree = "<group>"; };
|
||||
63CD4B4E1A5AAC8C00B84282 /* DTAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTAlertView.m; sourceTree = "<group>"; };
|
||||
63E59A391ADE6A0100646FB3 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
|
||||
63E59A3B1ADE6E5C00646FB3 /* in_app_products.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = in_app_products.plist; sourceTree = "<group>"; };
|
||||
63E59A3D1ADE6ECB00646FB3 /* InAppProductsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InAppProductsManager.h; sourceTree = "<group>"; };
|
||||
63E59A3E1ADE70D900646FB3 /* InAppProductsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InAppProductsManager.m; sourceTree = "<group>"; };
|
||||
63EF7FDC1A24B5810017A416 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/AboutViewController.strings; sourceTree = "<group>"; };
|
||||
|
|
@ -2043,8 +2054,16 @@
|
|||
22405EFD1601C19000B92522 /* ImageViewController.h */,
|
||||
22405EFE1601C19100B92522 /* ImageViewController.m */,
|
||||
D37EE11016035793003608A6 /* ImageViewController.xib */,
|
||||
6359DE811ADEB64100EA15C0 /* InAppProductsCell.h */,
|
||||
6359DE821ADEB64100EA15C0 /* InAppProductsCell.m */,
|
||||
6359DE831ADEB64100EA15C0 /* InAppProductsCell.xib */,
|
||||
63E59A3D1ADE6ECB00646FB3 /* InAppProductsManager.h */,
|
||||
63E59A3E1ADE70D900646FB3 /* InAppProductsManager.m */,
|
||||
6359DE891ADF9EB900EA15C0 /* InAppProductsTableViewController.h */,
|
||||
6359DE8A1ADF9EB900EA15C0 /* InAppProductsTableViewController.m */,
|
||||
6359DE7C1ADEB54200EA15C0 /* InAppProductsViewController.h */,
|
||||
6359DE7D1ADEB54200EA15C0 /* InAppProductsViewController.m */,
|
||||
6359DE7E1ADEB54200EA15C0 /* InAppProductsViewController.xib */,
|
||||
D31AAF5C159B3919002C6B02 /* InCallTableViewController.h */,
|
||||
D31AAF5D159B3919002C6B02 /* InCallTableViewController.m */,
|
||||
D3F83EE91582021700336684 /* InCallViewController.h */,
|
||||
|
|
@ -2240,7 +2259,6 @@
|
|||
F0B89C2518DC973E0050B60E /* wizard_linphone_create.rc */,
|
||||
F0B89C2618DC973E0050B60E /* wizard_linphone_existing.rc */,
|
||||
F0B89C2718DC973E0050B60E /* wizard_remote.rc */,
|
||||
63E59A3B1ADE6E5C00646FB3 /* in_app_products.plist */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -3331,6 +3349,7 @@
|
|||
D38327F71580FE3A00FA0D23 /* settings_default.png in Resources */,
|
||||
D38327F81580FE3A00FA0D23 /* settings_selected.png in Resources */,
|
||||
D38327F91580FE3A00FA0D23 /* chat_default.png in Resources */,
|
||||
6359DE801ADEB54200EA15C0 /* InAppProductsViewController.xib in Resources */,
|
||||
D38327FA1580FE3A00FA0D23 /* chat_selected.png in Resources */,
|
||||
D3832800158100E400FA0D23 /* contacts_over.png in Resources */,
|
||||
D3832801158100E400FA0D23 /* history_over.png in Resources */,
|
||||
|
|
@ -3367,8 +3386,8 @@
|
|||
D3F83F581582223B00336684 /* numpad_five_default.png in Resources */,
|
||||
D3F83F5A1582223B00336684 /* numpad_five_over.png in Resources */,
|
||||
D3F83F5C1582223B00336684 /* numpad_six_default.png in Resources */,
|
||||
6359DE851ADEB64100EA15C0 /* InAppProductsCell.xib in Resources */,
|
||||
636316D91A1DECC90009B839 /* PhoneMainView.xib in Resources */,
|
||||
63E59A3C1ADE6E5C00646FB3 /* in_app_products.plist in Resources */,
|
||||
D3F83F5E1582223B00336684 /* numpad_six_over.png in Resources */,
|
||||
D3F83F601582223B00336684 /* numpad_seven_default.png in Resources */,
|
||||
D3F83F621582223B00336684 /* numpad_seven_over.png in Resources */,
|
||||
|
|
@ -4039,10 +4058,13 @@
|
|||
D3807FFC15C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.m in Sources */,
|
||||
D3807FFE15C2894A005BE9BC /* IASKSlider.m in Sources */,
|
||||
D380800015C2894A005BE9BC /* IASKSwitch.m in Sources */,
|
||||
6359DE8B1ADF9EB900EA15C0 /* InAppProductsTableViewController.m in Sources */,
|
||||
D380800215C2894A005BE9BC /* IASKTextField.m in Sources */,
|
||||
D380800515C28A7A005BE9BC /* UILinphone.m in Sources */,
|
||||
D380801315C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */,
|
||||
6359DE7F1ADEB54200EA15C0 /* InAppProductsViewController.m in Sources */,
|
||||
D378AB2A15DCDB4A0098505D /* ImagePickerViewController.m in Sources */,
|
||||
6359DE841ADEB64100EA15C0 /* InAppProductsCell.m in Sources */,
|
||||
22405F001601C19200B92522 /* ImageViewController.m in Sources */,
|
||||
D3ED40191602172200BF332B /* HPGrowingTextView.m in Sources */,
|
||||
D3ED401B1602172200BF332B /* HPTextViewInternal.m in Sources */,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue