faf765abce
This commit also contains the 'log out' code for MSAL, by removing the oAuth2 token from the Graph Notifications Client. |
||
---|---|---|
.. | ||
GraphNotificationsSample | ||
.gitignore | ||
Podfile | ||
Podfile.lock | ||
README.md |
README.md
Sample App for running the Microsoft Graph notifications client library in your iOS application
Getting Started
Prerequisites
- Have xCode and Cocoapods installed installed. More details here
Building the sample
pod install
(from directory of podfile)build from xCode
Running the sample
- Build the sample (if is not built already).
- Initialize and setup MSAL using the directions given here
- Set the following values:
APPLICATION_CLIENT_ID
in Secrets.h: this is the client ID of your Azure AD client appAPP_HOST_NAME
in secrets.h: this is the "cross-device domain name" that you have registered and verified in your Cross-Device App registration in Partner Center (https://partner.microsoft.com/dashboard )
- Rebuild the application so that these secrets are used when attempting to log in and subscribe to notifications.
- Sign in with an Azure AD or MSA account.
- Click Subscribe, then grant permissions for the iOS app to read and write notifications.
- Click the other buttons to exercise the various functions.
- Post a new notification from Graph explorer and see a notification popup. Click the popup to be redirected to https://docs.microsoft.com/en-us/graph/notifications-concept-overview
Other tips
- Getting duplicate push notifications? This is a known server-side issue in some cases. See the README for the client itself to learn more. Look for the text starting with:
userNotificationApiImpl.processPushNotificationAsync(notificationPayload) may call back to the Graph notification server to fetch notification data
- To look at the logs of the sample app and the client library, the best way to do it is to set the xCode environment variable
CFNETWORK_DIAGNOSTICS
= 3