Purchasely / Purchasely-iOS

Purchasely iOS SDK
https://www.purchasely.com
Other
27 stars 0 forks source link

iOS errors after updating to XCode 15.0.1 #23

Closed LeonardoDemartino closed 11 months ago

LeonardoDemartino commented 11 months ago
Libraries/com.purchasely.unity/Native/IOS/PurchaselyBridge.mm:471:34: error: cannot initialize a parameter of type 'enum PLYAttribute' with an lvalue of type 'int'
        [Purchasely setAttribute:attribute value:value];
                                 ^~~~~~~~~
Libraries/com.purchasely.unity/Native/IOS/PurchaselyBridge.mm:2:
build/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/Purchasely/Purchasely.framework/Headers/Purchasely-Swift.h:1317:41: note: passing argument to parameter 'attribute' here
+ (void)setAttribute:(enum PLYAttribute)attribute value:(NSString * _Nonnull)value;
                                        ^
Libraries/com.purchasely.unity/Native/IOS/PurchaselyBridge.mm:471:50: error: cannot initialize a parameter of type 'NSString * _Nonnull' with an lvalue of type 'const char *'
        [Purchasely setAttribute:attribute value:value];

I have fixed this by changing:

void _purchaselySetAttribute(int attribute, const char* value) {
        [Purchasely setAttribute:attribute value:value];
}

TO

void _purchaselySetAttribute(int attribute, const char* value) {
        [Purchasely setAttribute:(PLYAttribute)attribute value:[NSString stringWithUTF8String:value]];
}
kherembourg commented 11 months ago

Thank you @LeonardoDemartino Must be changed in the Unity repo: https://github.com/Purchasely/Unity-Package/blob/main/Native/IOS/PurchaselyBridge.mm