Push Notifications
Stay organized with collections
Save and categorize content based on your preferences.
Overview
The Google Mobile Data Plan Sharing API also allows an operator to send
notifications to a user by pushing a
PlanStatus.
The API currently supports 7 types of notifications.
- Low Balance: when
PlanModule.coarseBalanceLevel
is set to
LOW_QUOTA
- Out of Data: when
PlanModule.coarseBalanceLevel
is set to
OUT_OF_DATA.
If in addition to this, the
PlanModule.overUsagePolicy
is set to PAY_AS_YOU_GO, then the user will be notified that they are about
to enter pay as you go mode.
- Data Expiration Warning: when
PlanModule.planModuleState
is set to
EXPIRING_SOON
- Plan Activation: when
PlanModule.planModuleState
is set to
NEWLY_ACTIVE
- Pay as you go: when
AccountInfo.payAsYouGoCharge
is populated with the amount that the user has spent.
- Account top up: when
AccountInfo.accountTopUp
and AccountInfo.accountBalance
are populated. Both these fields are required to send the account top up
notification to the user. If units and nanos in
AccountInfo.accountTopUp
are set to zero, then the top up amount is not in the notification.
- Data Expiration: when
PlanModule.planModuleState
is set to
EXPIRED.
This is for plans that are already expired.
One notification is sent to the user for each field set. If multiple
coarseBalanceLevel
or planModuleState
fields are set in a single
PlanStatus
, then an equal number of notifications will be sent to the user.
Requirements
A notification
PlanStatus SHOULD
contain as much information as possible about the user's mobile plan. For each
type of notification, the Data Plan Sharing API also defines a minimum set of
fields which are required to build the notification text. The operator MUST
include these fields in a notification PlanStatus.
Notification |
Required Fields |
Low Balance |
PlanModule.moduleName, PlanModule.byteBalance.remainingBytes |
Out of Data |
PlanModule.moduleName |
Data Expiration Warning |
PlanModule.moduleName, PlanModule.expirationTime |
Plan Activation |
PlanModule.moduleName |
Data Expiration |
PlanModule.moduleName |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-03 UTC."],[[["\u003cp\u003eThe Google Mobile Data Plan Sharing API enables operators to send seven types of notifications to users regarding their mobile data plans by pushing a PlanStatus.\u003c/p\u003e\n"],["\u003cp\u003eNotifications include alerts for low balance, out of data, data expiration warning/expiration, plan activation, pay as you go charges, and account top-ups.\u003c/p\u003e\n"],["\u003cp\u003eEach notification type requires a specific set of fields within the PlanStatus, including module name, balance details, and expiration time, to generate informative notification text.\u003c/p\u003e\n"],["\u003cp\u003eMultiple notifications can be triggered simultaneously if several fields like \u003ccode\u003ecoarseBalanceLevel\u003c/code\u003e or \u003ccode\u003eplanModuleState\u003c/code\u003e are set within a single PlanStatus.\u003c/p\u003e\n"],["\u003cp\u003eOperators should include as much relevant user plan information as possible within each notification PlanStatus for a comprehensive user experience.\u003c/p\u003e\n"]]],[],null,["# Push Notifications\n\nOverview\n--------\n\nThe Google Mobile Data Plan Sharing API also allows an operator to send\nnotifications to a user by pushing a\n[PlanStatus](./reference/rest/v1/operators.planStatuses#PlanStatus).\n\nThe API currently supports 7 types of notifications.\n\n1. **Low Balance** : when [PlanModule](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#PlanStatus.PlanModule).coarseBalanceLevel is set to [LOW_QUOTA](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#balancelevel)\n2. **Out of Data** : when [PlanModule](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#PlanStatus.PlanModule).coarseBalanceLevel is set to [OUT_OF_DATA](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#balancelevel). If in addition to this, the [PlanModule](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#PlanStatus.PlanModule).overUsagePolicy is set to PAY_AS_YOU_GO, then the user will be notified that they are about to enter pay as you go mode.\n3. **Data Expiration Warning** : when [PlanModule](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#PlanStatus.PlanModule).planModuleState is set to [EXPIRING_SOON](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#planstate)\n4. **Plan Activation** : when [PlanModule](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#PlanStatus.PlanModule).planModuleState is set to [NEWLY_ACTIVE](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#planstate)\n5. **Pay as you go** : when [AccountInfo](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#PlanStatus.AccountInfo).payAsYouGoCharge is populated with the amount that the user has spent.\n6. **Account top up** : when [AccountInfo](./reference/rest/v1/operators.planStatuses#AccountInfo).accountTopUp and [AccountInfo](./reference/rest/v1/operators.planStatuses#AccountInfo).accountBalance are populated. Both these fields are required to send the account top up notification to the user. If units and nanos in [AccountInfo](./reference/rest/v1/operators.planStatuses#AccountInfo).accountTopUp are set to zero, then the top up amount is not in the notification.\n7. **Data Expiration** : when [PlanModule](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#PlanStatus.PlanModule).planModuleState is set to [EXPIRED](/mobile-data-plan/v6_1/reference/rest/v1/operators.clients.users.planStatus#planstate). This is for plans that are already expired.\n\nOne notification is sent to the user for each field set. If multiple\n`coarseBalanceLevel` or `planModuleState` fields are set in a single\n`PlanStatus`, then an equal number of notifications will be sent to the user.\n\nRequirements\n------------\n\nA notification\n[PlanStatus](./reference/rest/v1/operators.planStatuses#PlanStatus) SHOULD\ncontain as much information as possible about the user's mobile plan. For each\ntype of notification, the Data Plan Sharing API also defines a minimum set of\nfields which are required to build the notification text. The operator MUST\ninclude these fields in a notification PlanStatus.\n\n| Notification | Required Fields |\n|-------------------------|--------------------------------------------------------------|\n| Low Balance | PlanModule.moduleName, PlanModule.byteBalance.remainingBytes |\n| Out of Data | PlanModule.moduleName |\n| Data Expiration Warning | PlanModule.moduleName, PlanModule.expirationTime |\n| Plan Activation | PlanModule.moduleName |\n| Data Expiration | PlanModule.moduleName |"]]