我想找出用户的App Store位置.这意味着他们在美国,澳大利亚(澳大利亚)商店.以下代码使用.
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
Books = response.products;
if ([SKPaymentQueue canMakePayments] && [response.products count]>0) {
}
for (SKProduct *book in Books) {
NSLocale *locat=[NSLocale currentLocale];
NSString *strlocate=[locat objectForKey:NSLocaleCountryCode];
NSLog(@"\n\n\n Device country== %@ \n\n\n",strlocate);
NSLocale* storeLocale = book.priceLocale;
NSString *storeCountry = (NSString*)CFLocaleGetValue((CFLocaleRef)storeLocale, kCFLocaleCountryCode);
NSLog(@"\n\n\n store country== %@ \n\n\n",storeCountry);
}
}
Run Code Online (Sandbox Code Playgroud)
我想要明智的是,如果图书等级是一个意味着US $ 0.99 AUD 0.99 JPY 85,基于应用商店价格矩阵表.
我在模拟器中测试过.我在系统中的iTunes,appstore和safari应用程序中更改了国家/地区名称.但我只得到美国国家代码.
编辑:设置 - >常规 - >国际 - >区域格式 - >国家/地区
我在设备中测试过:设备国家/地区仅更改.商店国家显示美国国家代码和价格.我想在开始购买时间之前存储国家/地区代码.
一旦基于货币波动改变价格多少天?是否为已知/更新提供任何api /查询波动的价格?
我的inapp操作成了一堂课.在inapp操作之前,我想向用户显示本地价格,在inapp操作中反映相同的价格效果.
我显示从我的服务器获取的书籍免费和付费书籍列表.因为我显示每个项目的价格.那些项目价格在处理appstore时会显示美元价格.如果appstore显示价格,我也想显示.所以我想从我的服务器发送国家代码到我的服务器响应该国家相关的价格表和货币符号..
我点击UIbutton
iPhone应用程序时试图打开相机.我想将捕获的图像存储在我指定的位置.
我需要显示共享epub文件中的封面图像(如iBooks和kindle).
假设我共享多本书意味着解压缩需要很长时间.
这是替代方式吗?
我在Google上花了更多时间.但我无法得到解决方案.
请用示例代码说明一下.
提前致谢.,
我试图在UIControlEventTouchDown
按钮按下事件上打开itunes链接.我的代码如下.
NSString *urlString =@"http://itunes.apple.com/in/album/carnatic-vocal-sanjay-subrahmanyan/id106924807?ign-mpt=uo%3D4";
NSString *str_ur=[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *url=[NSURL URLWithString:str_ur];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webview_buy loadRequest:requestObj];
webview_buy.delegate=self;
[self.view addSubview:webview_buy];
Run Code Online (Sandbox Code Playgroud)
这将转到设备中的itunes并打开itunes商店.但我收到一条警告信息
您的请求无法完成.
请用代码提出想法.
假设我的应用程序崩溃意味着在那个时候applicationWillTerminate
调用函数.在该功能中,我想将崩溃日志文件保存在Temporary目录中.当应用程序在那时启动时,我想通过编码将崩溃报告文件从iOS设备上传到我的服务器位置.
我正在使用此代码来保存崩溃日志文件.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"console.log"];
freopen([logPath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr);
Run Code Online (Sandbox Code Playgroud)
但是这段代码可以在模拟器中使用.我能够看到这个文件
/Users/UserNAme/Library/Application Support/iPhone Simulator/6.0/Applications/xxx-yyy-sss--eee/Documents/console.log
Run Code Online (Sandbox Code Playgroud)
但我无法在ios设备中找到此文件.
注意:在我正在使用的ios设备中查找文件 iExplorer
我正在使用以下Swift代码.
let sampleType : HKSampleType = HKSampleType.quantityTypeForIdentifier(HKQuantityTypeIdentifierHeartRate)
let nowDate: NSDate = NSDate()
var calendar: NSCalendar = NSCalendar.autoupdatingCurrentCalendar()
let yearMonthDay: NSCalendarUnit = NSCalendarUnit.YearCalendarUnit | NSCalendarUnit.MonthCalendarUnit | NSCalendarUnit.DayCalendarUnit
var components: NSDateComponents = calendar.components(yearMonthDay , fromDate: nowDate)
var beginOfDay : NSDate = calendar.dateFromComponents(components)!
var predicate : NSPredicate = HKQuery.predicateForSamplesWithStartDate(beginOfDay, endDate: nowDate, options: HKQueryOptions.StrictStartDate)
let squery: HKStatisticsQuery = HKStatisticsQuery(quantityType: sampleType, quantitySamplePredicate: predicate, options: HKStatisticsOptions.None) { (qurt, resul, errval) -> Void in
dispatch_async( dispatch_get_main_queue(), { () -> Void in
var quantity : HKQuantity = result.averageQuantity; …
Run Code Online (Sandbox Code Playgroud) 我正在为iPhone开发一款应用程序.如何在我的设备上测试此应用?
要遵循的程序是什么?请提供有关此问题的信息.
我开发了一款应用.我想在我的设备上测试我的应用程序.我没有在Apple注册.如何将身份识别到我的设备?如何在我的设备上运行我的应用程序?
请提供一步一步的说明,在我的设备上运行我的应用程序.