The feature you're describing is a local notification. See the docs here:
https://developer.apple.com/documentation/usernotifications
You cannot force notifications or their style on the user. That is what the Settings window in your screen shot is about. Only the user can decide whether your notification alert will appear as Temporary or Persistent. (The user can also decide to suppress your notifications completely.)