urbanairship/urbanairship-xamarin

Custom Actions in 16.1

amilici opened this issue · 2 comments

Custom Actions in 16.1

I currently have the following code to register an action for deep linking on iOS:

var action = UAAction.Action(HandleDeepLink, ShouldHandleDeepLink);
UAirship.Shared.ActionRegistry.UpdateAction(action, "deep_link_action");

UAAction.Action no longer exists. The migration guide for iOS states:

UAAction is now just a protocol instead of a concrete class. BlockAction was added to make it easy to provide a closure instead of defining a concrete class.

When registering actions in the ActionRegistry, the entry is no longer mutable. The action registry has been updated to allow updating the predicate directly instead of mutating the entry."

The documentation for the iOS SDK contains the following snippet:

 let customAction = BlockAction { args, completionHandler in
    print("Action is performing with args: \(args)")
    completionHandler(ActionResult.empty())
}

Airship.shared.actionRegistry.register(customAction, name:"custom_action") 

which looks very similar to what I am trying to do, however BlockAction does not seem to exist in the Xamarin Urban Airship bindings.

Is there another way to accomplish this?

Looks like we are missing types for it, Ill see if we can get them in the next release.

@amilici 15.0.1 is released and it should contains the BlockAction. Please let us know if you have any questions.