-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[in_app_purchase] Define clang module for iOS #2125
Conversation
| #import "InAppPurchasePlugin.h" | ||
|
|
||
| NS_ASSUME_NONNULL_BEGIN | ||
| API_AVAILABLE(ios(11.2), macos(10.13.2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added availability.
| @"localizedTitle" : @"title", | ||
| @"localizedDescription" : @"des", | ||
| }]; | ||
| if (@available(iOS 11.2, *)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added availability so these tests passed with older SDKs.
| @@ -0,0 +1,206 @@ | |||
| // Copyright 2019 The Chromium Authors. All rights reserved. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These test files were moved from the example/ project to the new Tests/ directory. Added symlinks from the old location so the tests still pass in the example app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out Xcode really didn't link the symlinking. I changed the Xcode project to just point at the new location instead of following the symlinks.
| @@ -1,183 +0,0 @@ | |||
| // Copyright 2019 The Chromium Authors. All rights reserved. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cyanglaz This test doesn't compile and wasn't included in the Xcode project, so I deleted it. I can file an issue for it to be re-added and fixed to pass, if you still find value in it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please add this test case back to the project and remove the .testing part to fix the compilation. I am not sure why it would be like this in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
mklim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but @cyanglaz should also review and approve.
cyanglaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. Left some comments.
| payment.applicationUsername = [paymentMap objectForKey:@"applicationUsername"]; | ||
| NSNumber *quantity = [paymentMap objectForKey:@"quantity"]; | ||
| payment.quantity = quantity ? quantity.integerValue : 1; | ||
| payment.quantity = (quantity != nil) ? quantity.integerValue : 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the different or benefit we gain with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fixes a static analyzer warning:
157:24: warning: Converting a pointer value of type 'NSNumber *' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
payment.quantity = quantity ? quantity.integerValue : 1;
| @interface FIAPReceiptManagerStub : FIAPReceiptManager | ||
| @end | ||
|
|
||
| API_AVAILABLE(ios(7.0), macos(10.9)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flutter supports 8 and up so this might not be necessary. I'm ok leave it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove it, most of the others should also have API_AVAILABLE(ios(7.0), macos(10.9)) so this isn't consistent.
| author: Flutter Team <[email protected]> | ||
| homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase | ||
| version: 0.2.1+4 | ||
| version: 0.2.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no public API change, we just need to update the patch, thus 0.2.1+5
I might have missed something though. Please point it out if so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only public API change was adding the nullability return value. The podspec change means this will be imported as a module, so modulemaps get generated, and CocoaPods does a lot of other magic. I'm happy to change this to 0.2.1+5 though!
…pecially deployment target
Description
DEFINES_MODULEin the podspec. See CocoaPod modular headers docs.VALID_ARCHSto architectures included in the Flutter universal binary. This is the CocoaPods-suggested workaround to prevent tests from running on the i386 simulator. See Fix linting when armv7 is included but i386 isn't CocoaPods/CocoaPods#8159.-boolValueRelated Issues
Fixes flutter/flutter#41648.
See also flutter/flutter#41007.
Tests
s.platformands.pod_target_xcconfigchanges.Checklist
///).flutter analyze) does not report any problems on my PR.Breaking Change