phoboslab / Ejecta

A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS
2.81k stars 322 forks source link

IAPManager - no response & no error message #670

Open smith-chris opened 5 years ago

smith-chris commented 5 years ago

I believe I did setup everything correctly apart from Paid Apps - Agreements, Tax & Billing. According to stackoverflow this is the reason why testing IAP on sandbox user is not working.

I think it would be wise to give any information to the developer why the request is failing. I've debugged the native part of the binding and the "productsRequest" callback method (or rather delegate? I'm new to obj-c) is never called. Following stackoverflow further, I've added this piece of code to the implementation of "EJBindingIAPManager":

- (void)request:(SKRequest *)request didFailWithError:(NSError *)error {
    NSLog(@"IAP: request - didFailWithError: %@", [[error userInfo] objectForKey:@"NSLocalizedDescription"]);
}

But it still gives me nothing. I have single log in the xcode console apart from "IAP: Requesting product info: fvv.extraTime". I think there should be a developer friendly message send to the js regardless of what kind of error happens, whether it's the developer not setting up thing correctly or apple server not responding in time. Right now you'd have to timeout the request by hand on js side and show generic error to the user.

What would be the way to catch all request errors in this situation? I just started learning obj-c yesterday so I feel a bit lost