Closed WahibAbdul closed 4 years ago
Did you find a solution? I'm experiencing the same issue.
Did you find a solution? I'm experiencing the same issue.
Yes. In iOS setup documentation it is missing some configuration info.
Add this line in AppDelegate.swift file.
GeofencingPlugin.setPluginRegistrantCallback { (registry) in GeneratedPluginRegistrant.register(with: registry) }
And in your Bridging-Header.h file add this:
#import <geofencing/GeofencingPlugin.h>
This solved my problem and everything is working perfectly now. @JFreakDK it would be nice if you can update documentation about iOS setup.
Sounds like you've found a solution, but let me know if there's something I'm missing here and I'll reopen.
Hi @WahibAbdul, I notice you said "AppDelegate.swift", but this library seems to be in Flutter, and the example iOS plugin code seems to use Objective-C. Is this an original AppDelegate.swift that you wrote? Or am I missing something?
Hi @WahibAbdul, I notice you said "AppDelegate.swift", but this library seems to be in Flutter, and the example iOS plugin code seems to use Objective-C. Is this an original AppDelegate.swift that you wrote? Or am I missing something?
, yes but in flutter in the ios folder you have AppDelegate.swift. it's pretty empy but go ahead and make changes as per this thread and it will stop the crashing and work.
@toniree for objective c you can copy and paste the code below:
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import <geofencing/GeofencingPlugin.h>
void registerPlugins(NSObject<FlutterPluginRegistry>* registry) {
if( ![registry hasPlugin:@"io.flutter.plugins.geofencing"] ) {
[GeofencingPlugin registerWithRegistrar:[registry registrarForPlugin:@"io.flutter.plugins.geofencing"]];
}
}
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
[GeofencingPlugin setPluginRegistrantCallback:registerPlugins];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
I have copied all the code from example into a new flutter project, main file is exactly the same as example project. Added information in info.plist file but Calling GeofencingManager.initialize() is crashing application with this error but download repo example project is working fine.
Flutter Doctor