diff --git a/Classes/Base.lproj/ShopView.xib b/Classes/Base.lproj/ShopView.xib
new file mode 100644
index 000000000..0edad4a8d
--- /dev/null
+++ b/Classes/Base.lproj/ShopView.xib
@@ -0,0 +1,243 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Classes/InAppProductsManager.h b/Classes/InAppProductsManager.h
index 61a61b351..6b6fcb539 100644
--- a/Classes/InAppProductsManager.h
+++ b/Classes/InAppProductsManager.h
@@ -45,6 +45,8 @@ typedef NSString *IAPPurchaseNotificationStatus;
// paid_account_id=test.autorenew_7days
// receipt_validation_url=https://www.linphone.org/inapp.php
// products_list=test.autorenew_7days
+// expiry_check_period = 86400
+// warn_before_expiry_period = 604800
// Note: in Sandbox mode (test), autorenewal expire time is speed up (see
// http://stackoverflow.com/questions/8815271/what-expiry-date-should-i-see-for-in-app-purchase-in-the-application-sandbox)
// so that 7 days renewal is only 3 minutes and:
@@ -57,11 +59,19 @@ typedef NSString *IAPPurchaseNotificationStatus;
@interface InAppProductsManager : NSObject {
NSString *latestReceiptMD5;
+ time_t lastCheck;
+ time_t expiryTime;
}
@property(nonatomic, strong) IAPPurchaseNotificationStatus status;
@property(nonatomic, strong) NSMutableArray *productsAvailable;
@property(nonatomic, strong) NSMutableArray *productsIDPurchased;
+//Period of time between each expiration check. Default value is given in linphonerc.
+@property time_t checkPeriod;
+//Period of time before expiration during which we warn the user about the need to renew the account.
+@property time_t warnBeforeExpiryPeriod;
+//The notification category to use for displaying notification related to account expiry.
+@property NSString *notificationCategory;
// TRUE when in app purchase capability is available - not modified during runtime
@property(readonly) BOOL enabled;
@@ -82,7 +92,7 @@ typedef NSString *IAPPurchaseNotificationStatus;
andEmail:(NSString *)email
monthly:(BOOL)monthly;
// Purchase a product. You should not use this if manager is not available yet.
-- (BOOL)purchaseWitID:(NSString *)productID;
+- (BOOL)purchaseWithID:(NSString *)productID;
// Activate purchased account.
- (BOOL)activateAccount:(NSString *)phoneNumber;
@@ -92,6 +102,9 @@ typedef NSString *IAPPurchaseNotificationStatus;
// Warning: on first run, this will open a popup to user to provide iTunes Store credentials
- (BOOL)retrievePurchases;
+//Check if account is about to expire, and if yes launch a notification.
+- (void)check;
+
// internal API only due to methods conflict
- (void)XMLRPCRequest:(XMLRPCRequest *)request didReceiveResponse:(XMLRPCResponse *)response;
// internal API only due to methods conflict
diff --git a/Classes/InAppProductsManager.m b/Classes/InAppProductsManager.m
index 729d14a56..0cb1cca82 100644
--- a/Classes/InAppProductsManager.m
+++ b/Classes/InAppProductsManager.m
@@ -18,6 +18,7 @@
*/
#import "InAppProductsManager.h"
+#import "ShopView.h"
// In app purchase are not supported by the Simulator
#import
@@ -36,10 +37,16 @@
@property(nonatomic, strong) InAppProductsXMLRPCDelegate *xmlrpc;
@end
+
+
@implementation InAppProductsManager
+@synthesize checkPeriod;
+@synthesize warnBeforeExpiryPeriod;
+@synthesize notificationCategory;
+
// LINPHONE_CAPABILITY_INAPP_PURCHASE must be defined in Linphone Build Settings
-#if LINPHONE_CAPABILITY_INAPP_PURCHASE && !TARGET_IPHONE_SIMULATOR
+#if 1
- (instancetype)init {
if ((self = [super init]) != nil) {
@@ -48,6 +55,14 @@
_initialized = false;
_available = false;
_accountActivationInProgress = false;
+ checkPeriod = [LinphoneManager.instance lpConfigIntForKey:@"expiry_check_period" inSection:@"in_app_purchase"];
+ warnBeforeExpiryPeriod = [LinphoneManager.instance lpConfigIntForKey:@"warn_before_expiry_period" inSection:@"in_app_purchase"];
+ lastCheck = 0;
+
+ int testExpiry = [LinphoneManager.instance lpConfigIntForKey:@"expiry_time_test" inSection:@"in_app_purchase"];
+ if (testExpiry > 0){
+ expiryTime = time(NULL) + testExpiry;
+ }else expiryTime = 0;
if (_enabled) {
self.xmlrpc = [[InAppProductsXMLRPCDelegate alloc] init];
_status = kIAPNotReady;
@@ -76,7 +91,7 @@
return false;
}
-- (BOOL)purchaseWitID:(NSString *)productID {
+- (BOOL)purchaseWithID:(NSString *)productID {
if (!_enabled || !_initialized || !_available) {
NSDictionary *dict = @{
@"product_id" : productID,
@@ -111,7 +126,7 @@
inSection:@"in_app_purchase"];
self.accountCreationData = @{ @"phoneNumber" : phoneNumber, @"password" : password, @"email" : email };
- if (![self purchaseWitID:productID]) {
+ if (![self purchaseWithID:productID]) {
self.accountCreationData = nil;
}
return true;
@@ -301,13 +316,9 @@
NSString *phoneNumber = @"";
LinphoneProxyConfig *config = linphone_core_get_default_proxy_config(LC);
if (config) {
- const char *identity = linphone_proxy_config_get_identity(config);
+ const LinphoneAddress *identity = linphone_proxy_config_get_identity_address(config);
if (identity) {
- LinphoneAddress *addr = linphone_core_interpret_url(LC, identity);
- if (addr) {
- phoneNumber = [NSString stringWithUTF8String:linphone_address_get_username(addr)];
- linphone_address_destroy(addr);
- }
+ phoneNumber = [NSString stringWithUTF8String:linphone_address_get_username(identity)];
}
}
return phoneNumber;
@@ -476,6 +487,64 @@
NSDictionary *dict = @{ @"error_msg" : errorString };
[self postNotificationforStatus:kIAPReceiptFailed withDict:dict];
}
+
+- (void) presentNotification:(int64_t) remaining{
+ if (notificationCategory == nil) return;
+ int days = (int)remaining / (3600 * 24);
+ NSString * expireText;
+ if (remaining >= 0){
+ expireText = [NSString stringWithFormat:NSLocalizedString(@"Your account will expire in %i days.", nil), days];
+ }else{
+ expireText = [NSString stringWithFormat:NSLocalizedString(@"Your account has expired.", nil), days];
+ }
+
+ if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground){
+ UILocalNotification *notification = [[UILocalNotification alloc] init];
+ if (notification) {
+
+ notification.category = notificationCategory;
+ notification.repeatInterval = 0;
+ notification.applicationIconBadgeNumber = 1;
+ notification.alertBody = expireText;
+
+ [[UIApplication sharedApplication] presentLocalNotificationNow:notification];
+ }
+
+ }else{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Account expiring"
+ message:expireText
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* buyAction = [UIAlertAction actionWithTitle:@"Buy" style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction * action) {
+ [PhoneMainView.instance changeCurrentView:ShopView.compositeViewDescription];
+ }];
+
+ UIAlertAction* laterAction = [UIAlertAction actionWithTitle:@"Later" style:UIAlertActionStyleCancel
+ handler:^(UIAlertAction * action) {
+ // [alert dismissViewControllerAnimated:FALSE];
+ }];
+
+ [alert addAction:buyAction];
+ [alert addAction:laterAction];
+ [PhoneMainView.instance presentViewController:alert animated:YES completion:nil];
+ }
+}
+
+- (void) check{
+ if (!_available) return;
+ if (expiryTime == 0 || checkPeriod == 0) return;
+
+ time_t now = time(NULL);
+
+ if (now < lastCheck + checkPeriod) return;
+ if (now >= expiryTime - warnBeforeExpiryPeriod){
+ lastCheck = now;
+ int64_t remaining = (int64_t)expiryTime - (int64_t)now;
+ [self presentNotification: remaining];
+ }
+}
+
#else
- (void)postNotificationforStatus:(IAPPurchaseNotificationStatus)status {
_status = status;
@@ -497,7 +566,7 @@
[self postNotificationforStatus:kIAPRestoreFailed];
return false;
}
-- (BOOL)purchaseWitID:(NSString *)productID {
+- (BOOL)purchaseWithID:(NSString *)productID {
[self postNotificationforStatus:kIAPPurchaseFailed];
return FALSE;
}
diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m
index 8e9b01daa..aa5e15211 100644
--- a/Classes/LinphoneAppDelegate.m
+++ b/Classes/LinphoneAppDelegate.m
@@ -18,6 +18,7 @@
*/
#import "PhoneMainView.h"
+#import "ShopView.h"
#import "linphoneAppDelegate.h"
#import "AddressBook/ABPerson.h"
@@ -99,6 +100,7 @@
[self fixRing];
}
}
+ [LinphoneManager.instance.iapManager check];
}
#pragma deploymate push "ignored-api-availability"
@@ -170,6 +172,14 @@
return localRingNotifAction;
}
+- (UIUserNotificationCategory *)getAccountExpiryNotificationCategory {
+
+ UIMutableUserNotificationCategory *expiryNotification = [[UIMutableUserNotificationCategory alloc] init];
+ expiryNotification.identifier = @"expiry_notification";
+ return expiryNotification;
+}
+
+
- (void)registerForNotifications:(UIApplication *)app {
LinphoneManager *instance = [LinphoneManager instance];
@@ -179,7 +189,7 @@
UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
NSSet *categories =
- [NSSet setWithObjects:[self getCallNotificationCategory], [self getMessageNotificationCategory], nil];
+ [NSSet setWithObjects:[self getCallNotificationCategory], [self getMessageNotificationCategory], [self getAccountExpiryNotificationCategory], nil];
UIUserNotificationSettings *userSettings =
[UIUserNotificationSettings settingsForTypes:notifTypes categories:categories];
[app registerUserNotificationSettings:userSettings];
@@ -224,6 +234,7 @@
}];
[LinphoneManager.instance startLinphoneCore];
+ LinphoneManager.instance.iapManager.notificationCategory = @"expiry_notification";
// initialize UI
[self.window makeKeyAndVisible];
[RootViewManager setupWithPortrait:(PhoneMainView *)self.window.rootViewController];
@@ -357,6 +368,11 @@
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
LOGI(@"%@ - state = %ld", NSStringFromSelector(_cmd), (long)application.applicationState);
+
+ if ([notification.category isEqual:LinphoneManager.instance.iapManager.notificationCategory]){
+ [PhoneMainView.instance changeCurrentView:ShopView.compositeViewDescription];
+ return;
+ }
[self fixRing];
diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m
index 7b7b8760b..9e831c331 100644
--- a/Classes/LinphoneManager.m
+++ b/Classes/LinphoneManager.m
@@ -1741,6 +1741,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
LOGW(@"It seems that Linphone BG mode was deactivated, just skipping");
return;
}
+ [_iapManager check];
// kick up network cnx, just in case
[self refreshRegisters];
linphone_core_iterate(theLinphoneCore);
@@ -2396,7 +2397,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
- (void)inappReady:(NSNotification *)notif {
// Query our in-app server to retrieve InApp purchases
- [_iapManager retrievePurchases];
+ //[_iapManager retrievePurchases];
}
#pragma mark -
diff --git a/Classes/ShopView.h b/Classes/ShopView.h
new file mode 100644
index 000000000..f6dc827fb
--- /dev/null
+++ b/Classes/ShopView.h
@@ -0,0 +1,35 @@
+/* AboutViewController.h
+ *
+ * Copyright (C) 2009 Belledonne Comunications, Grenoble, France
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#import
+
+#import "UICompositeView.h"
+
+@interface ShopView : TPMultiLayoutViewController
+
+@property(weak, nonatomic) IBOutlet UILabel *accountProductTitle;
+@property(weak, nonatomic) IBOutlet UILabel *accountProductDescription;
+@property(weak, nonatomic) IBOutlet UILabel *accountProductPrice;
+@property(weak, nonatomic) IBOutlet UIButton *accountBuyButton;
+
+- (IBAction)onLinkTap:(id)sender;
+- (IBAction)onDialerBackClick:(id)sender;
+- (IBAction)onPurchaseButtonClick:(id)sender;
+
+@end
diff --git a/Classes/ShopView.m b/Classes/ShopView.m
new file mode 100644
index 000000000..745cad8e5
--- /dev/null
+++ b/Classes/ShopView.m
@@ -0,0 +1,82 @@
+/* AboutViewController.m
+ *
+ * Copyright (C) 2009 Belledonne Comunications, Grenoble, France
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#import "PhoneMainView.h"
+#import "ShopView.h"
+#import "LinphoneManager.h"
+#import "LinphoneIOSVersion.h"
+
+@implementation ShopView
+
+#pragma mark - UICompositeViewDelegate Functions
+
+static UICompositeViewDescription *compositeDescription = nil;
+
++ (UICompositeViewDescription *)compositeViewDescription {
+ if (compositeDescription == nil) {
+ compositeDescription = [[UICompositeViewDescription alloc] init:self.class
+ statusBar:StatusBarView.class
+ tabBar:nil
+ sideMenu:SideMenuView.class
+ fullscreen:false
+ isLeftFragment:YES
+ fragmentWith:nil];
+ }
+ return compositeDescription;
+}
+
+- (UICompositeViewDescription *)compositeViewDescription {
+ return self.class.compositeViewDescription;
+}
+
+#pragma mark - ViewController Functions
+
+- (void)viewDidLoad {
+ InAppProductsManager *aipm = LinphoneManager.instance.iapManager;
+ NSMutableArray *productsAvailable = aipm.productsAvailable;
+ if ( [productsAvailable count] > 0){
+ SKProduct *product = [productsAvailable objectAtIndex:0];
+ [_accountProductTitle setText:product.localizedTitle];
+ [_accountProductDescription setText:product.localizedDescription];
+
+ NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
+ [numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
+ [numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
+ [numberFormatter setLocale:product.priceLocale];
+ NSString *formattedString = [numberFormatter stringFromNumber:product.price];
+ [_accountProductPrice setText:formattedString];
+ }
+ [super viewDidLoad];
+
+}
+
+#pragma mark - Action Functions
+
+- (IBAction)onLinkTap:(id)sender {
+
+}
+
+- (IBAction)onDialerBackClick:(id)sender {
+ [PhoneMainView.instance popToView:DialerView.compositeViewDescription];
+}
+
+- (IBAction)onPurchaseButtonClick:(id)sender {
+ [PhoneMainView.instance popToView:DialerView.compositeViewDescription];
+}
+@end
diff --git a/Classes/SideMenuTableView.m b/Classes/SideMenuTableView.m
index 15c99db3e..d49ad5805 100644
--- a/Classes/SideMenuTableView.m
+++ b/Classes/SideMenuTableView.m
@@ -11,6 +11,8 @@
#import "PhoneMainView.h"
#import "StatusBarView.h"
+#import "ShopView.h"
+#import "LinphoneManager.h"
@implementation SideMenuEntry
@@ -47,6 +49,14 @@
[PhoneMainView.instance
changeCurrentView:SettingsView.compositeViewDescription];
}]];
+ InAppProductsManager *iapm = LinphoneManager.instance.iapManager;
+ if (iapm.enabled){
+ [_sideMenuEntries addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"Shop", nil)
+ tapBlock:^() {
+ [PhoneMainView.instance
+ changeCurrentView:ShopView.compositeViewDescription];
+ }]];
+ }
[_sideMenuEntries addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"About", nil)
tapBlock:^() {
[PhoneMainView.instance
diff --git a/Classes/en.lproj/ShopView.strings b/Classes/en.lproj/ShopView.strings
new file mode 100644
index 000000000..ff6c0ae4e
--- /dev/null
+++ b/Classes/en.lproj/ShopView.strings
@@ -0,0 +1,30 @@
+
+/* Class = "UIButton"; accessibilityLabel = "Add contact"; ObjectID = "ETk-tB-ZNl"; */
+"ETk-tB-ZNl.accessibilityLabel" = "Add contact";
+
+/* Class = "UILabel"; text = "GNU General Public License V2\n© 2010-2016 Belledonne Communications"; ObjectID = "ToT-OI-B2F"; */
+"ToT-OI-B2F.text" = "GNU General Public License V2\n© 2010-2016 Belledonne Communications";
+
+/* Class = "UILabel"; text = "Label"; ObjectID = "Ui2-bF-EnK"; */
+"Ui2-bF-EnK.text" = "Label";
+
+/* Class = "UILabel"; text = "LINPHONE"; ObjectID = "fss-Tl-kRy"; */
+"fss-Tl-kRy.text" = "LINPHONE";
+
+/* Class = "UILabel"; text = "Linphone Core 3.9.0"; ObjectID = "g2W-u5-yxg"; */
+"g2W-u5-yxg.text" = "Linphone Core 3.9.0";
+
+/* Class = "UILabel"; text = "SHOP"; ObjectID = "iNt-9d-7si"; */
+"iNt-9d-7si.text" = "SHOP";
+
+/* Class = "UILabel"; text = "Linphone iPhone 3.0"; ObjectID = "oYk-ih-BBi"; */
+"oYk-ih-BBi.text" = "Linphone iPhone 3.0";
+
+/* Class = "UILabel"; text = "https://www.linphone.org"; ObjectID = "uis-xz-Qsa"; */
+"uis-xz-Qsa.text" = "https://www.linphone.org";
+
+/* Class = "UIButton"; accessibilityLabel = "Add contact"; ObjectID = "vX8-wO-ZEN"; */
+"vX8-wO-ZEN.accessibilityLabel" = "Add contact";
+
+/* Class = "UILabel"; text = "ABOUT"; ObjectID = "wKp-iH-ojJ"; */
+"wKp-iH-ojJ.text" = "ABOUT";
diff --git a/Classes/fr.lproj/ShopView.strings b/Classes/fr.lproj/ShopView.strings
new file mode 100644
index 000000000..e598c42d6
--- /dev/null
+++ b/Classes/fr.lproj/ShopView.strings
@@ -0,0 +1,30 @@
+
+/* Class = "UIButton"; accessibilityLabel = "Add contact"; ObjectID = "ETk-tB-ZNl"; */
+"ETk-tB-ZNl.accessibilityLabel" = "Add contact";
+
+/* Class = "UILabel"; text = "GNU General Public License V2\n© 2010-2016 Belledonne Communications"; ObjectID = "ToT-OI-B2F"; */
+"ToT-OI-B2F.text" = "GNU General Public License V2\n© 2010-2016 Belledonne Communications";
+
+/* Class = "UILabel"; text = "Purchase"; ObjectID = "Ui2-bF-EnK"; */
+"Ui2-bF-EnK.text" = "Purchase";
+
+/* Class = "UILabel"; text = "LINPHONE"; ObjectID = "fss-Tl-kRy"; */
+"fss-Tl-kRy.text" = "LINPHONE";
+
+/* Class = "UILabel"; text = "Linphone Core 3.9.0"; ObjectID = "g2W-u5-yxg"; */
+"g2W-u5-yxg.text" = "Linphone Core 3.9.0";
+
+/* Class = "UILabel"; text = "SHOP"; ObjectID = "iNt-9d-7si"; */
+"iNt-9d-7si.text" = "SHOP";
+
+/* Class = "UILabel"; text = "Linphone iPhone 3.0"; ObjectID = "oYk-ih-BBi"; */
+"oYk-ih-BBi.text" = "Linphone iPhone 3.0";
+
+/* Class = "UILabel"; text = "https://www.linphone.org"; ObjectID = "uis-xz-Qsa"; */
+"uis-xz-Qsa.text" = "https://www.linphone.org";
+
+/* Class = "UIButton"; accessibilityLabel = "Add contact"; ObjectID = "vX8-wO-ZEN"; */
+"vX8-wO-ZEN.accessibilityLabel" = "Add contact";
+
+/* Class = "UILabel"; text = "ABOUT"; ObjectID = "wKp-iH-ojJ"; */
+"wKp-iH-ojJ.text" = "ABOUT";
diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory
index ca2e1672e..6da3ed209 100644
--- a/Resources/linphonerc-factory
+++ b/Resources/linphonerc-factory
@@ -1,4 +1,12 @@
[app]
+
+#Hide in the assistant the button to configure an external SIP account.
+hide_assistant_custom_account=0
+
+#Hide in the assistant the button to create a new SIP account
+hide_assistant_create_account=0
+
+
#contact_display_username_only=1
#contact_filter_on_default_domain=1
#debug_popup_magic=**00**
@@ -11,15 +19,42 @@ publish_presence=0
password_length=-1
username_length=-1
+[in_app_purchase]
+#set to 1 if in-app purchases are to be shown in the application
+enabled=0
+
+#specify here the id of the sip account in-app purchase service to be shown in the shop section of the app
+paid_account_id=sipAccount_12m
+
+#the url of the inapp/account management server, for submitting the receipt and validating the account.
+receipt_validation_url=https://www.linphone.org/inapp.php
+
+#for future use, to specify the full list of paying services to show in the shop view
+products_list=sipAccount_12m
+
+#minimum period of time between notifications to the user about his expiring/expired account, in seconds.
+expiry_check_period=30
+
+#period of time before account expiry, to start notifying the user about expiration arriving, in seconds.
+warn_before_expiry_period=160
+
+#for test only, simulate an account expiry after the specified number of seconds
+expiry_time_test=180
+
+[sip]
+sip_random_port=0
+
[misc]
#by default it is set to 30 by liblinphone
history_max_size=-1
-[sip]
-sip_random_port=0
+#whether SIP passwords are to be encrypted in configuration storage file
store_ha1_passwd=0
#handle_content_encoding=none
+
+
+
[sound]
dtmf_player_amp=0.007
echocancellation=0
@@ -28,4 +63,4 @@ eq_location=mic
ringer_dev_id=AQ: Audio Queue Device
[video]
-display_filter_auto_rotate=0
\ No newline at end of file
+display_filter_auto_rotate=0
diff --git a/doc/CUSTOMIZING.txt b/doc/CUSTOMIZING.txt
new file mode 100644
index 000000000..6fa0a155f
--- /dev/null
+++ b/doc/CUSTOMIZING.txt
@@ -0,0 +1,20 @@
+# Assistant configuration
+
+The assistant allows to create a new sip account on a pre-defined SIP service using an xml-rpc connection,
+as well as configuring an existing SIP account.
+The files Resources/assistant_linphone_create.rc and Resources/assistant_linphone_existing.rc contain the
+information necessary to create and configure the SIP accounts, most notabily:
+ * proxy_default_values/reg_identity to define the SIP identity
+ * sip/rls_uri to define the SIP URI of the presence server
+ * assistant/domain to specify the SIP domain
+ * assistant/xmlrpc_url to specify the https url of the account creation service
+
+# In-app purchase configuration
+
+The Resources/linphonerc.factory, section [in_app_purchase] is the entry point for configuring
+the in-app purchases available in the application, as well as parameters for account expiry notifications.
+Refer to the inlined comments in this configuration for description of all configurables.
+
+
+
+
diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj
index 7be993c8a..6367cc89f 100755
--- a/linphone.xcodeproj/project.pbxproj
+++ b/linphone.xcodeproj/project.pbxproj
@@ -40,6 +40,9 @@
34216F401547EBCD00EA9777 /* VideoZoomHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 34216F3F1547EBCD00EA9777 /* VideoZoomHandler.m */; };
344ABDF114850AE9007420B6 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 344ABDEF14850AE9007420B6 /* libc++.1.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
344ABDF214850AE9007420B6 /* libstdc++.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 344ABDF014850AE9007420B6 /* libstdc++.6.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 570742581D5A0691004B9C84 /* ShopView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 570742561D5A0691004B9C84 /* ShopView.xib */; };
+ 570742611D5A09B8004B9C84 /* ShopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5707425F1D5A09B8004B9C84 /* ShopView.m */; };
+ 570742671D5A63DB004B9C84 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 570742661D5A63DB004B9C84 /* StoreKit.framework */; };
630589E71B4E810900EFAE36 /* ChatTester.m in Sources */ = {isa = PBXBuildFile; fileRef = 630589DF1B4E810900EFAE36 /* ChatTester.m */; };
630589E81B4E810900EFAE36 /* ContactsTester.m in Sources */ = {isa = PBXBuildFile; fileRef = 630589E11B4E810900EFAE36 /* ContactsTester.m */; };
630589EA1B4E810900EFAE36 /* LinphoneTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 630589E41B4E810900EFAE36 /* LinphoneTestCase.m */; };
@@ -934,6 +937,12 @@
34216F3F1547EBCD00EA9777 /* VideoZoomHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VideoZoomHandler.m; path = LinphoneUI/VideoZoomHandler.m; sourceTree = ""; };
344ABDEF14850AE9007420B6 /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "usr/lib/libc++.1.dylib"; sourceTree = SDKROOT; };
344ABDF014850AE9007420B6 /* libstdc++.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.dylib"; path = "usr/lib/libstdc++.6.dylib"; sourceTree = SDKROOT; };
+ 570742571D5A0691004B9C84 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ShopView.xib; sourceTree = ""; };
+ 5707425F1D5A09B8004B9C84 /* ShopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopView.m; sourceTree = ""; };
+ 570742601D5A09B8004B9C84 /* ShopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopView.h; sourceTree = ""; };
+ 570742631D5A1860004B9C84 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ShopView.strings; sourceTree = ""; };
+ 570742651D5A1868004B9C84 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/ShopView.strings; sourceTree = ""; };
+ 570742661D5A63DB004B9C84 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
630589DE1B4E810900EFAE36 /* ChatTester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatTester.h; sourceTree = ""; };
630589DF1B4E810900EFAE36 /* ChatTester.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatTester.m; sourceTree = ""; };
630589E01B4E810900EFAE36 /* ContactsTester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsTester.h; sourceTree = ""; };
@@ -1814,6 +1823,7 @@
63CFEE0A1B9EDD88007EA5BD /* libmssilk.a in Frameworks */,
63CFEE0B1B9EDD88007EA5BD /* libmswebrtc.a in Frameworks */,
63CFEE0C1B9EDD88007EA5BD /* libmsx264.a in Frameworks */,
+ 570742671D5A63DB004B9C84 /* StoreKit.framework in Frameworks */,
63CFEDF61B9EDD74007EA5BD /* libopencore-amrnb.a in Frameworks */,
63CFEDF71B9EDD74007EA5BD /* libopencore-amrwb.a in Frameworks */,
63CFEDF81B9EDD74007EA5BD /* libopenh264.a in Frameworks */,
@@ -1935,7 +1945,10 @@
children = (
22E0A81D111C44E100B04932 /* AboutView.h */,
22E0A81C111C44E100B04932 /* AboutView.m */,
+ 5707425F1D5A09B8004B9C84 /* ShopView.m */,
+ 570742601D5A09B8004B9C84 /* ShopView.h */,
636316D31A1DEBCB0009B839 /* AboutView.xib */,
+ 570742561D5A0691004B9C84 /* ShopView.xib */,
D350F20B15A43BB100149E54 /* AssistantView.h */,
D350F20C15A43BB100149E54 /* AssistantView.m */,
D38187E015FE348A00C3EDCA /* AssistantView.xib */,
@@ -2171,6 +2184,7 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 570742661D5A63DB004B9C84 /* StoreKit.framework */,
636920661D253DF700D44CAC /* libbcunit.a */,
637835A41CFD971D00599382 /* libbv16.a */,
63FD3F061CA17F9100E9AECC /* libmbedcrypto.a */,
@@ -3106,7 +3120,10 @@
DevelopmentTeam = Z2V957B3D6;
SystemCapabilities = {
com.apple.InAppPurchase = {
- enabled = 0;
+ enabled = 1;
+ };
+ com.apple.Push = {
+ enabled = 1;
};
};
};
@@ -3702,6 +3719,7 @@
633FEE121D3CD5590014B822 /* chat_message_not_delivered.png in Resources */,
633FEDCE1D3CD5590014B822 /* call_quality_indicator_1.png in Resources */,
633FEF4E1D3CD55A0014B822 /* valid_default.png in Resources */,
+ 570742581D5A0691004B9C84 /* ShopView.xib in Resources */,
633FEE361D3CD5590014B822 /* conference_exit_over.png in Resources */,
633FEDAA1D3CD5590014B822 /* backspace_disabled.png in Resources */,
F0938159188E629800A55DFA /* iTunesArtwork in Resources */,
@@ -3858,6 +3876,7 @@
63B81A101B57DA33009604A6 /* UIScrollView+TPKeyboardAvoidingAdditions.m in Sources */,
F03CA84318C72F1A0008889D /* UITextViewNoDefine.m in Sources */,
63B81A0D1B57DA33009604A6 /* TPKeyboardAvoidingCollectionView.m in Sources */,
+ 570742611D5A09B8004B9C84 /* ShopView.m in Sources */,
63F1DF4F1BCE985F00EDED90 /* UICallConferenceCell.m in Sources */,
D37DC6C11594AE1800B2A5EB /* LinphoneCoreSettingsStore.m in Sources */,
63CD4B4F1A5AAC8C00B84282 /* DTAlertView.m in Sources */,
@@ -3983,6 +4002,16 @@
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
+ 570742561D5A0691004B9C84 /* ShopView.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 570742571D5A0691004B9C84 /* Base */,
+ 570742631D5A1860004B9C84 /* en */,
+ 570742651D5A1868004B9C84 /* fr */,
+ );
+ name = ShopView.xib;
+ sourceTree = "";
+ };
63058A0F1B4E821E00EFAE36 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
@@ -4445,7 +4474,6 @@
"-Werror=objc-method-access",
"-Werror=incomplete-implementation",
"-Wno-error-deprecated",
- "-DLINPHONE_CAPABILITY_INAPP_PURCHASE=0",
);
};
name = Debug;
@@ -4533,7 +4561,6 @@
"-Werror=objc-method-access",
"-Werror=incomplete-implementation",
"-Wno-error-deprecated",
- "-DLINPHONE_CAPABILITY_INAPP_PURCHASE=0",
);
};
name = DistributionAdhoc;
@@ -4620,7 +4647,6 @@
"-Werror=objc-method-access",
"-Werror=incomplete-implementation",
"-Wno-error-deprecated",
- "-DLINPHONE_CAPABILITY_INAPP_PURCHASE=0",
);
};
name = Release;
@@ -4708,7 +4734,6 @@
"-Werror=objc-method-access",
"-Werror=incomplete-implementation",
"-Wno-error-deprecated",
- "-DLINPHONE_CAPABILITY_INAPP_PURCHASE=0",
);
};
name = Distribution;