Requiring login from settings

Is there a way when loading a channel to prompt the settings for a user to login? Right now, I’m using the MessageContainer to prompt the user to update their settings, but it would be nice if the settings were popped up by default.

Also, are there any docs about handling the response from the settings? I’m unclear where this hooks in to. For example, I need to do a few things.

  1. Check if username and password are defined in settings
  2. If not, prompt the user to enter their credentials
  3. Make a request to determine if the credentials are valid, prompt the user if they are not (I assume message container can work for errors), otherwise store some data in session.

Thank you

I don’t know of a way to prompt the user for settings beside the one you mention(message)

As for your other question, add a routine named ValidatePrefs() to your init.py code, this routine is called whenever the settings are updated/saved.

Here is an example github.com/plexinc-plugins/TV4-Play.bundle/blob/master/Contents/Code/init.py#L53

Great, thank you. The example is helpful. Do you know if there’s a way to refresh the screen or the main handler once it’s been updated?

You can tell a client to refresh by using the “no_cache” attribute of an ObjectContainer:
github.com/plexinc-plugins/TV4-Play.bundle/blob/master/Contents/Code/init.py#L86