在 Office365 应用程序中保存用户设置的位置
Where to save user setting in an Office365 app
我正在为 Office365 开发一个应用程序(特定于 Outlook),但我对将用户设置保存在何处有疑问。
由于我托管在服务器上,此应用程序针对的是 Office365 网络版。 Office365 的用户可以去商店安装应用程序。然而,在 s/he 可以使用该应用程序之前,s/he 必须设置一些字段才能使用该插件。
我不确定是否有办法为用户保留设置。
好吧,我想既然应用程序托管在我自己的服务器上,另一方面,用户已经通过身份验证,我可以根据用户的某些独特功能保留设置,例如用户名,通过服务器中的常规方法。
您可以使用 RoamingSetting 对象 API 为每个用户保存插件的私人数据。
// Get the current value of the 'myKey' setting
var value = Office.context.roamingSettings.get('myKey');
// Update the value of the 'myKey' setting
Office.context.roamingSettings.set('myKey', 'Hello World!');
// Persist the change
Office.context.roamingSettings.saveAsync();
有关详细信息,请查看上面提供的文档 link。
如果您想要为 email/calendar 项(而不是整个邮箱)的外接程序保存数据,请查看 CustomProperties 对象 API。
我正在为 Office365 开发一个应用程序(特定于 Outlook),但我对将用户设置保存在何处有疑问。
由于我托管在服务器上,此应用程序针对的是 Office365 网络版。 Office365 的用户可以去商店安装应用程序。然而,在 s/he 可以使用该应用程序之前,s/he 必须设置一些字段才能使用该插件。
我不确定是否有办法为用户保留设置。
好吧,我想既然应用程序托管在我自己的服务器上,另一方面,用户已经通过身份验证,我可以根据用户的某些独特功能保留设置,例如用户名,通过服务器中的常规方法。
您可以使用 RoamingSetting 对象 API 为每个用户保存插件的私人数据。
// Get the current value of the 'myKey' setting
var value = Office.context.roamingSettings.get('myKey');
// Update the value of the 'myKey' setting
Office.context.roamingSettings.set('myKey', 'Hello World!');
// Persist the change
Office.context.roamingSettings.saveAsync();
有关详细信息,请查看上面提供的文档 link。
如果您想要为 email/calendar 项(而不是整个邮箱)的外接程序保存数据,请查看 CustomProperties 对象 API。