Call a method from Today extension

negazirnegazir USMember ✭✭
edited October 2017 in Xamarin.iOS

Good day, I have the Xamarin iOS VS project and Today widget extension.

Right now, to get the information to the widget, I call an Update() method from iOS project, which pass data to widget as an App group container. I do it every time the app starts.

    public void Update(string balance)
    {
    var appdef = new NSUserDefaults("group.myveryowntest", NSUserDefaultsType.SuiteName);
    appdef.SetString(balance, "balance");
    appdef.Synchronize();
    }

But I also need to refresh the widget from a button on the widget- so the Update() method should be called. Is that even possible?

Tagged:

Best Answer

Answers

Sign In or Register to comment.