I'm currently trying to implement Facebook SDK into my Unity App but I can't find the AppDelegate.m
that I must modify in order to implement the SDK.
I tried searching everywhere in my Xcode folder but it seems nowhere to be found.
I search on google too but as I really don't understand anything to Xcode (except from building my Unity Project), I don't understand the answers too...
Thanks, and have a nice day !
The file name “AppDelegate.m” is a generic reference to “the file that contains the definition of your application delegate class”. Your app is not required to name the file “AppDelegate.m” however, so you’ll need to find yours.
Somewhere in your app there is a class that implements the UIApplicationDelegate
protocol. You should search for “UIApplicationDelegate” using Xcode’s search function. That should put you on the right track to finding the class. Whichever file that class is in is the file you need to refer to when other documentation says AppDelegate.m
I forgot that in objective-c you don't declare adoption of a protocol. Here is a different way to find your app delegate.
Find your main.m file (this file is required, so you'll definitely have one). It will contain code like this:
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([YourAppDelegateClassName class]));
}
}
The interesting piece is [YourAppDelegateClassName class]
, since this represents the class of your application delegate. Do a search for the first word in the square brackets, in this case it is YourAppDelegateClassName
.
You can find it by searching UIApplicationDelegate in xcode search, then you will find the implemenation of this protocol in some file named as something.h
.that's the file which you needed.
In Xcode 13.3.1 the file would be the (AppName)App file. This file defines the entry point for the app. This file is where you would define the app delegate class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With