how to fix Problem with FCAlertView In a ios tweak

99 Views Asked by At

Hello every one Im making my first tweak in Facebook App to do a simple tasks But im trying to use FCAlertView alert https://github.com/nimati/FCAlertView in my project I used this code to view the alert in facebook main page

#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>
#import "FCAlertView.h" 
#import <MessageUI/MessageUI.h>
 %config(generator=internal)
%hook FBBaseAppDelegate
- (void)applicationDidBecomeActive:(id)arg1 {
    %orig;
        FCAlertView *alert = [[FCAlertView alloc] init];
       [alert showAlertWithTitle:@“Test Alert"
              withSubtitle:@"This is alert's subtitle."
           withCustomImage:nil
       withDoneButtonT itle:nil
                andButtons:nil];
}
%end

But there is an error

“ undefined symbol: OBJC_CLASS$_FCAlertview"

Im using xcode ( alone monkey ) to make a tweak

1

There are 1 best solutions below

0
Itay Brenner On

When building your code, gcc cannot find where FCAlertView is defined because you are not compiling it.

For MonkeyDev:
Make sure FCAlertView.m is inside your project AND you added it to the correct target

For theos:
You should add all your source files (in this case only FCAlertView.m) to your Makefile inside the _FILES parameter. Something like this:

YOURTWEAKNAME_FILES = main.m FCAlertView.m