Xamarin linking and event subscription

In Xamarin iOS I get this issue if linking is set to 'Don't Link'

MTOUCH : error MT5214: Native linking failed, undefined symbol: _UAButtonStyleKey. This symbol was referenced by the managed member UrbanAirship.Constants.UAButtonStyleKey. Please verify that all the necessary frameworks have been referenced and native libraries linked.

The same thing happens in the sample app. This isn't a problem in Release mode, but in Debug mode linking needs to be disabled or Xamarin Hot Reload stops working completely. This significantly affects development time on any Xamarin.iOS or Xamarin.Forms project that uses UrbanAirship.

Additionally, the getting started docs don't make any mention about how to subscribe to events. The React Native docs have a nice section on events, is there a similar page for Xamarin?

Thank you

Didn't find what you were looking for?

New post

Comments

3 comments

  • bdean,

    To use the Airship SDK with your application you will need to link the SDK. We recommend using the linking setting Link Framework SDKs Only.

    Xamarin Hot Reload might not work, this is a known issue that Microsoft has stated about the feature. However, the Airship SDK does not work in an emulator and is required to be tested on a device. Our SDK requires access to the APNS push token to be able to send messages to users and Apple does not allow the iOS emulator to register for push notifications.

    Thank you,

    Eric L.
    Technical Support Engineer
    Airship | Portland

    Comment actions Permalink
  • Thanks Eric. Any pointers to documentation on event subscriptions?

    And, even if I won't change your mind - maybe just a feature request for the linking? Let me explain why this is needed and possible. This isn't a Microsoft bug. OneSignal, AppCenter, and Google FCM all have SDKs for push notifications and they work fine with linking either turned off (debug mode) or turned on (release mode). (Not to mention all the non-push notification SDKs that also work.) It isn't just a matter of running on an emulator vs a physical device. (Push Notifications work fine on a GenyMotion emulator with GApps installed.) But notifications are only one small part of an application. Once that implementation is done the app still has to be worked on by the development team every single work day and now, because of the limitation of the UrbanAirship SDK, it can't be built without linking.

    Comment actions Permalink
    0
  •  

    We don't have specific documentation that matches that section in the React Native docs. However you can take a look at both the native SDK and the Xamarin SDK samples on adding additional listeners/delegates for events here:

    Xamarin: https://github.com/urbanairship/urbanairship-xamarin/blob/master/samples/ios-unified/AppDelegate.cs#L59

    iOS: https://github.com/urbanairship/ios-library/blob/master/Sample/Sample/AppDelegate.m#L78

    I can put in a feature request to have the SDK work in debug mode. I understand the need for the feature, but a can't guarantee that it is possible or be added to the roadmap.

    As a side note Google allows for testing push in an emulator, that is why the GenyMotion emulator works. Apple does not work the same way. For testing APNS or using a device token, a physical device is required. 

    Thank you,

    Eric L.
    Technical Support Engineer
    Airship | Portland

    Comment actions Permalink
    0

Please sign in to leave a comment.