Where to save user setting in an Office365 app - office365-apps

I am developing an app for Office365 (to be specific for Outlook) and I am having a question about where to keep the user settings.
This app is targeted for web version of Office365 as a result I hosted on a server. A user of Office365 can go to the store and install the app. However before s/he can use the app, s/he has to set a few fields to be able to use the add-on.
I am not sure if there is a way to keep the settings for a user.

You can use the RoamingSetting object API to save private data for your Addin for each user.
// 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();
For more information, look at the documentation link provided above.
If you instead want to save data for your Addin for an email/calendar item (instead of for an entire mailbox), look at the CustomProperties object API.

Well, I guess since the app is hosted on my own server, and on the other hand, the user is already authenticated, I can keep the settings per some unique feature of user, e.g. username, by conventional methods in the server.

Related

Firebase: Standard User Registration/Activation Workflow

I need to implement a standard user registration/activation workflow with Firebase. There doesn't seem to be an obvious way to implement this. When I say "standard", I mean how most email/password accounts work - not necessarily specific to Firebase. I'm sure you're familiar with this. This is the workflow:
User enters their username/password on a form with some validation and submits details
The back-end creates the user record in the database, but the account remains deactivated (i.e. user cannot authenticate - the activated flag is set to false)
The back-end sends an email to the user with a link to activate the account
The user clicks the link in their email which triggers activation. This is probably a Web API of some description.
At this point, the user record's activated flag ticks over to true, and the user can now authenticate
The link probably also has a deep link that opens the app or navigates to a web page
The user can now log into the app
How do I configure Firebase to do all this?
Currently, the app allows the user to register. I am using the Flutterfire SDK. I call createUserWithEmailAndPassword, which successfully creates the user in Firebase. But, the user is already activated. The user should have a state of "disabled" in firebase until the account becomes activated. I can't find any settings to default the user to disabled when the account is first created.
I also managed to get Firebase to send out an activation email by calling sendSignInLinkToEmail, but this call is really designed for email authentication - not email activation. Opening the link should activate the account, but I have not figured out how to do this. This documentation makes it sound like it is possible. Perhaps, the Flutterfire SDK is missing this? I don't want to allow people to log in without a password. I only want to use this call to send out an email.
What am I missing here? Is this non-standard behavior for Firebase? If so, why? If the user is allowed to use an app with an email address that is not activated, they can impersonate someone else. We need to confirm at least that they are custodians of the email address that they are claiming to have.
Do other Firebase people just not worry about this?
Lastly, I know I can achieve this by creating a collection for users in Firebase and putting an "activated" flag there. But, if I do that, I've got to write a cloud function that accepts the link and then updates the user in the collection based on the received link. But I thought this would be automatic in Firebase. If Firebase doesn't have this built-in, I have to put all the security over the top to stop users from authenticating when they have not yet activated their account.
This is a pretty valid concern. I suppose the way around this is to check whether the signed-in user is verified whenever the app is launched. The User object that is returned from Firebase Auth has an emailVerified flag. Check this page for more details.
Using this flag you can choose to show a different screen or pop-up that has a button to send a verification link to the registered email address. Until the user verifies this address, you can limit access to some of the app's screens if you want.
Please note that I have not checked if this emailVerified flag is true for sign ups using Federated login providers like Google Sign-in and Apple Sign In. You might want to check that out.

When to create PFInstallation

I am new to using PFinstallations on Parse, and i am a bit confused as to how they work. I have an app that creates a new installation when a user creates an account, and i set the "User" field of the installation to the users userId so i can send them notifications easily later. I dont understand how the installation works when the user logs out or closes the app. In order to be able to always send the user a notification, must i create new installations periodically when these events (ie. logging out or closing the app) occur?
You shouldn't ever need to create an instance of PFInstallation. The parse framework will handle that for you if you access it using PFInstallation.currentInstallation(). But to save it to the backend, you'll need to call one of the save methods yourself.
By default, logging out will have no impact on the installation since it is a method on the user. You can have you own logic that modifies the installation on logout to, for example, clear the user field or channels.
The parse framework writes the installation to disk on the users device. When the app stops running and then restarts, parse can just read that data from disk and have the proper PFInstallation object again.

Is it possible to save a custom variable for each user on their account?

I just got starte with programming a Facebook app. I already wrote an app for the VZ-Network, and there they have something called 'Persistant Storage'. Basically its an environment where you can save custom data on each user account. With your app you can read this data from the current user as well as from the users friends. Now I want to port my app to Facebook and my problem is that I didn't find such functionality here yet.
For now I would like to finish and launch this as soon as possible, so it would be nice if I could c&p as much of the code as possible.
Since the data is contains information about participation, at some point I would like to use the Facebook event object. But I was wondering if that could cause problems since it would require to create those events publically in order to use them in my app. Couldn't that lead to legal problems when I create such events with those who actually host the events in the real world? Would I have to ask the hosts to create those events, could I automate this process, or in case they don't have a Facebook account ask them to approve that the app creates the event for them?
I also need to know in what events the users friends participate, so I can't simply save the information on my server, since I don't have the friend info there.
In any case, it seems much easier to me to simply use a list of EventIDs on each user account to check whether or not the user participates in an event.

Can we move Google Analytics data to other account?

Started a webpage that now contains a lot of analytic data. Now that I have the client GA Tracking ID I would like to move the data I already have to that account.
Is this possible?
I get the Google Analytics API, I can always fetch all the data I want, but my problem is, upon I have the data how can I send / push this data to other account
in other words, How can I transfer data?
The domain is the same, only the account Id in use was a different one (my own, instead of the client's)
It is not possible:
You cannot currently transfer profiles or account data from one account to another account.
Google Analytics does not provide any flexibility with importing, exporting, or modifying any past data. Any data you have in one account cannot be moved to another.
With GA, the only way to get data in to an account is directly via __utm.gif requests, usually through their JavaScript snippet, but that doesn't allow for any way to import past data, since the date is fixed according to when the data is sent in.
Further, the Google Analytics API is read-only, and doesn't provide any way to import or move data.
(This answer is slightly less true for Universal Analytics
http://piwik.org/ is a good alternative, open source analytics system, not unlike Google Analytics, but without some of the constraints like this.
I think now it's possible to move data from one account to another.
Check out this article:
https://support.google.com/analytics/answer/6370521?hl=en
If you need to reorganize your properties in Analytics, you can move them (and their views) from one account to another.
Moving properties lets you keep your Analytics implementation current with your business. You might be reorganizing after a merger, after an internal restructuring, after hiring a new agency, or you might be developing a new Roll-Up strategy.
This was not possible in 2011 when the question was originally asked. Google added this capability to GA in 2016 (source). In addition to Google's documentation which engray provided, there are several blog posts which discuss how.
How to transfer a Google Analytics property from one Google Account to another
How to Move a Property to Another Account in Google Analytics
How to move a property:
Sign in to Google Analytics & navigate to Admin section.
In the ACCOUNT column choose the account that contains the property you want to move.
In the PROPERTY column, select the property you want to move.
Click Property Settings, then click Move property.
Select the destination account.
Choose your permissions settings.
Click Move.
Confirm data processing, then click Save.
Might be possible to do this as i was curious and found a few forum posts mentioning it:
Log into GA.
Goto the Account List.
Find your web property, you can't click the 'property' itself but a profile under it...
Then click on Admin on top-right side.
Go 'Up' a Level.
For example the breadcrumb says:
'Account list' › 'FOO (www.foo.com)' › 'FOO (www.foo.com) - (Default Profile)'
and now the breadcrumb should say when you click 2nd breadcrumb link:
'Account list' › 'FOO (www.foo.com)'
Now you have an option to add other users to this whole web property by going to the Users tab.
Add an Administrator user to this specific property. You can setup this user for them on gmail that they can change the password later after you set it up (or use their Google Account email they provide and maybe walk through with them to make sure they do it correctly).
Then login as that user, and delete the old user. Then that should 'transfer' to a new account.
What I do in this situation - export all data from Google account and import it into Tableau or QlickView. And use desktop analysis. In any case these data will be actual no more than 2 years.

iOS identify user(s)

I am building app that will serve some content to the users via my private server. At the server-side I would like to identify user, so that I don't serve same content twice to the same user. How can I identify user(s)?
One way is DeviceID, but user can have multiple devices...?
Is the only way to have my own user IDs for my application (registration). I don't like this as it adds extra complexity to the app.
I know it's a hard task, but maybe facial recognition (from the webcam) could help in logging in users, since it doesn't imply any relation between user and device.
For example, face.com offers a free web-based API for facial recognition.
Although, Ishu's answer (username/password) is the easiest and most standard way to do identify users.
Make an id for user's and also a login page in the app. save his id with in you content table for send that content for that user. if that content entry already having his id then don't send to him otherwise send to him.
I don't think there is another option. You must use user id nothing else.