-
Notifications
You must be signed in to change notification settings - Fork 136
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
fix all Framework imports that would break cocoapods installation #319
Conversation
@@ -1,7 +1,5 @@ | |||
#import <Foundation/Foundation.h> | |||
|
|||
@import AppCenter; |
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.
Don't we need some header for MSWrapperSdk type?
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.
Also in AppCenterReactNativeShared.m file we need header for MSAppCenter type
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.
You're right.. I wasn't able to properly build the framework before, not sure why but it should be good to go now. Built and checked.
I've use forward declaration on the header and imported the right header in the .m
file, still not requiring a @import
which has been the issue for our integration flow.
@@ -11,6 +9,7 @@ | |||
#endif | |||
|
|||
@class AppCenterReactNativePush; | |||
@protocol MSPushDelegate; |
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.
Missing empty line before protocol
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.
✅
let me know how does it look now guys. Thank you! |
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 build fails for the TestApp, as for the newly created app. Here is the error message:
...../TestApp/node_modules/appcenter/ios/AppCenterReactNative/AppCenterReactNative.m:20:9: 'AppCenterReactNativeShared/AppCenterReactNativeShared.h' file not found.
Adding folder to Headers search path fixes the issue.
I think this was not the case because we were using import module syntax, but this is not 100%.
That's strange now everything compiles, maybe that is because I was performing all those operations manually and missed something. |
@bmourat hey.. any idea of when this will be merged into |
Hi, we release our SDKs the third week of the month. If you need packages before you can run |
Great! thanks for the quick response @guperrot |
Hey @fcerdeiral, thanks for the contribution, your PR is merged and will be shipped in our June SDK release. |
This PR will fix cocoapods integration for the libraries
appcenter
,appcenter-crashes
andappcenter-push
. They're currently failing due to wrong use of@import
statements inside its headers and implementation files. These libraries should build without the need to importAppCenter
directly, just by knowing theirs.h
files.The issue can be demonstrated if you try to integrate using purely cocoapods and not by adding the xcode project files inside your project. If done so you should get an error like this one:
This change removes that import from the header file and replaces it with a Forward Declaration of the class or protocol if needed. Then inside the implementation file the needed header is imported using
#import <Framework/Header.h>
format instead of the module format, that should work for all cases.