Donated intent's NSUserActivity is reset. Why?

I am donating an INPlayMediIntent to siri with INPlayMediaIntentResponseCodeHandleInApp and associated userActivity:


        NSUserActivity *userActivity = [[NSUserActivity alloc]initWithActivityType:@"com.myapp.UserActivity_PlayA"];
        userActivity.eligibleForSearch=true;
        userActivity.eligibleForPrediction=true;
        userActivity.title = intentInformationTitle;
        userActivity.needsSave=true;
        userActivity.userInfo = @{@"identifier":identifier,@"name":name};
        userActivity.persistentIdentifier = [NSString stringWithFormat:@"ua_PlayA_%@",identifier];
        userActivity.requiredUserInfoKeys=[NSSet setWithArray:userActivity.userInfo.allKeys];
        [userActivity becomeCurrent];


(I tried the above code block with various options, all had the same result..)


I have already added the activity type to my plist.

While testing on device (iOS12.1 iPhoneX), I touch the relevant shortcut/search item through the search box that appears when I drag the homescreen down, it runs the app and it receives continueUserActivity but the acitivity's userInfo is nil.


I have read many posts related to similar problem but I do not believe that overriding the saving method of user activity is a good idea. I must be doing something wrong. I will be glad, may you share your experience.

Replies

This active user activity is separate from the donated INPlayMediaIntent. Donating the media intent without the user activity is sufficient for surfacing your app's media content as a Shortcut. Is there a specific reason you need this user activity to pair with the media intent?