我得到"这个应用程序购买已经被购买它将被免费恢复"但代表updatedTransactions没有被调用,没有任何反应,IAP没有执行.
我已经实现了恢复购买,它工作正常,但我如何阻止用户再次购买非消耗品?为什么没有调用委托updatedTransactions(SKPaymentTransactionState.Restored)?
即使在删除并重新安装应用程序后进行购买也会显示此弹出窗口.
这是我的代码.如果我做错了,请告诉我.谢谢
func makePaymentForProduct(product:SKProduct){
let payment = SKPayment.init(product: product)
SKPaymentQueue.defaultQueue().addPayment(payment)
SKPaymentQueue.defaultQueue().addTransactionObserver(self)
}
func restorePurchases(){
SKPaymentQueue.defaultQueue().restoreCompletedTransactions()
SKPaymentQueue.defaultQueue().addTransactionObserver(self)
}
//MARK: SKProductsRequestDelegate
func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse) {
self.delegate?.didGetProducts(response.products)
}
func request(request: SKRequest, didFailWithError error: NSError) {
self.delegate?.purchaseFailed(error.localizedDescription)
}
//MARK: SKPaymentTransactionObserver
func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for (_, transaction) in transactions.enumerate() {
switch (transaction.transactionState) {
case SKPaymentTransactionState.Purchased:
self.completeTransaction(transaction)
break
case SKPaymentTransactionState.Restored:
self.restoreTransaction(transaction)
break
case SKPaymentTransactionState.Failed:
self.failedTransaction(transaction)
break
default:
break
}
}
}
func completeTransaction(transaction:SKPaymentTransaction){
self.delegate?.purchaseSuccessful()
SKPaymentQueue.defaultQueue().finishTransaction(transaction)
}
func …Run Code Online (Sandbox Code Playgroud) 我在安装了openfire会议的EC2 ubuntu服务器上设置了openfire.使用管理控制台http:// myserver:9090 /配置焦点用户,测试用户,群聊和内容.
多用户视频会议使用https:// myserver:7443/ofmeet /?r = testroom在Chrome浏览器上正常运行.
现在我想在iOS应用程序中实现这一点,我不知道从哪里开始.我确实调查了一些演示项目,但仍然无法弄明白.
有人可以帮忙吗?如果有人使用过这样的东西,请告诉我.谢谢
我在AppDelegate方法中使用此代码创建了一个专辑
NSString *albumName=@"999Videos";
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library addAssetsGroupAlbumWithName:albumName
resultBlock:^(ALAssetsGroup *group) {
NSLog(@"added album:%@", albumName);
}
failureBlock:^(NSError *error) {
NSLog(@"error adding album");
}];
Run Code Online (Sandbox Code Playgroud)
现在我想将录制的视频保存到这个创建的999Videos专辑中.不是我这样做的photosAlbum.
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:outputFileURL])
{
[library writeVideoAtPathToSavedPhotosAlbum:outputFileURL
completionBlock:^(NSURL *assetURL, NSError *error)
Run Code Online (Sandbox Code Playgroud)
视频正在保存但不在999Videos相册中.有人可以告诉我如何将视频保存到我的自定义相册中?
我在我的应用程序中有这个歌曲的播放列表.我想使用蓝牙在这个播放列表上播放另一个设备(iphone)上的歌曲.
这就是我所做的
#import "BrowseStationsViewController.h"
@interface BrowseStationsViewController (){
GKSession *gkSession;
}
@end
@implementation BrowseStationsViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
#pragma mark -
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view
[self setupSession];
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
// Register for notifications when the application leaves the background state
// on its way to becoming the active application.
[defaultCenter addObserver:self …Run Code Online (Sandbox Code Playgroud) 我使用下面的代码和国家名称,但它返回null.
NSLocale *locale = [NSLocale currentLocale];
NSString *countryCode = [locale objectForKey: NSLocaleCountryCode];
NSString *country = [locale displayNameForKey: NSLocaleCountryCode value: countryCode];
NSLog(@"Language : %@ Lang2 : %@",[[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0],[[NSLocale preferredLanguages] objectAtIndex:0]);
NSLog(@"Locale:%@ Code:%@ Name%@:", locale, countryCode, country);
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
fr,
de,
nl,
ja,
es,
tr,
it,
pl,
pt,
);
Run Code Online (Sandbox Code Playgroud)
日志:区域设置:<__ NSCFLocale:0x7fbef943f810>代码:(null)名称(null)
语言:nl Lang2:nl
在设备上测试了和simulator.i不知道什么在here.It去应该工作fine.Please让我知道,如果你们有任何idea.i我使用的Xcode 6.4.
如何在我的选择器视图中隐藏分隔符.这是截图
.
这是我的自定义UIPickerView的代码.
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
UILabel *label=[[UILabel alloc]init];
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor whiteColor];
label.textAlignment=NSTextAlignmentCenter;
switch (component) {
case 0:
label.text=[_hourArray objectAtIndex:row];
label.font = [UIFont fontWithName:@"MYRIADPRO-REGULAR" size:70];
break;
case 1:
label.text=[_minutesArray objectAtIndex:row];
label.font = [UIFont fontWithName:@"MYRIADPRO-REGULAR" size:70];
break;
case 2:
label.text=[_ampmArray objectAtIndex:row];
label.font = [UIFont fontWithName:@"MYRIADPRO-REGULAR" size:15];
break;
default:
break;
}
return label;
}
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 3;
}
Run Code Online (Sandbox Code Playgroud)
请帮帮我.谢谢
试图在WKWebView中使用自定义字体,但没有运气.
let htmlString = "<span style=\"font-family: 'OpenSans-Bold'; font-size: 30; color: white\">\(Utils.aboutUsText)</span>"
webView.loadHTMLString(htmlString, baseURL: nil)
Run Code Online (Sandbox Code Playgroud)
我可以使用HelveticaNeue-Bold并且效果很好,但不能使用上面的自定义字体.
let htmlString = "<span style=\"font-family: 'HelveticaNeue'; font-size: 30; color: white\">\(Utils.aboutUsText)</span>"
webView.loadHTMLString(htmlString, baseURL: nil)
Run Code Online (Sandbox Code Playgroud)
我已正确添加自定义字体.查看截图.
有人可以告诉我如何实现这一目标或指出我正确的方向.
我有这个字符串,我想在标签中显示:
NSString *criticsScore=[NSString stringWithFormat:@"%@\%%",[dict objectForKey:@"critics_score"]];
_criticRating.text=criticsScore;
Run Code Online (Sandbox Code Playgroud)
我想设置一个小字体\%%和一个大字体[dict objectForKey:@"critics_score"]];
这是否可能?