Has anyone been able to successfully apply the UrbanAirship component from the Component store?
I did all the necessary steps but it seems to have a null pointer at UAirship.Push.UserPushNotificationsEnabled = true;
I am also having the same issue. I have added the AirshipConfig.plist and have the following, where I am getting the same exception:
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
UAirship.Push.UserPushNotificationsEnabled = true; //This is where there is a NullReferenceException
LoadApplication (new App ());
return base.FinishedLaunching (app, options);
@ChristineLuong I figured it out.
Make sure you do the following:
Set the Build Action on the AirshipConfig file to Content and the Copy to output directory to Always copy to have the file copied to the device.
That will get it working for you.
Awesome, @JesseMock ! Thanks so much! Will be making that change and let you know.
I believe you can also set the build action as BundleResource.
UAirship.Push can be null if the app keys, secrets (Dev, Prod) are not properly set in AirshipConfig.plist.
Doing what was suggested by @JesseMock worked!
AirshipConfig.plist needs to be copied over the app bundle when building – the most straightforward way is set BundleResource as the build action. It's also fine to instantiate and configure a UAConfig instance in code and pass that directly to takeOff, if that's easier. The platform docs at http://docs.urbanairship.com/platform/xamarin.html should be updated soon with that extra information.
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies