Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applicationUsername is null #201

Open
morteza2128 opened this issue Dec 14, 2016 · 0 comments
Open

applicationUsername is null #201

morteza2128 opened this issue Dec 14, 2016 · 0 comments

Comments

@morteza2128
Copy link

I want send additional data with purchase, and I used applicationUsername for setting userId
In restore transactions, 'applicationUsername' is empty and also I used requestData but still is nil.
Is there any way to save data with purchase and get it back in restore or at least save userId.

[[RMStore defaultStore] restoreTransactionsOfUser:USERID onSuccess:^(NSArray *transactions){

    [self verifyTransactions:transactions];
    
    [transactions enumerateObjectsUsingBlock:^(SKPaymentTransaction   * _Nonnull transaction, NSUInteger idx, BOOL * _Nonnull stop) {
       
        NSString *productID = transaction.payment.productIdentifier;
        NSLog(@"product identifier:%@",transaction.originalTransaction.payment.productIdentifier);
        NSLog(@"application username:%@",transaction.originalTransaction.payment.applicationUsername);

        
        if (![purchasedBeforeArr containsObject:productID]) {
        
            NSDictionary *productDict = @{@"productId":productID,@"orderId":transaction.transactionIdentifier,@"date":[NSString stringWithFormat:@"%@",transaction.transactionDate]};
            
          //  NSLog(@"application username:%@",transaction.payment.requestData);
            [muArr addObject:productDict];
        }
        
        
        

    }];        
} failure:^(NSError *error) {
    
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant