Models: push and notices
Devices, pushes and the inbox of notices, from package:crm_sdk/wire.dart.
import 'package:crm_sdk/wire.dart';| Name | What it is |
|---|---|
CrmConsent | What PurrCRM keeps of the guest’s choices about its pushes. |
CrmConsentBody | What the guest chose in the host’s own screens about PurrCRM’s pushes. |
CrmDeviceBody | The device the host’s Firebase gave a registration token for, which the package registers on every start and whenever the token changes. |
CrmExportDevice | One device the guest registered for pushes, in their export, without its token. |
CrmExportNotice | One notice in the guest’s inbox, in their export. |
CrmForgetDeviceBody | The token the package registered, forgotten as the guest signs out so that the next guest on the phone is not pushed the last one’s. |
CrmNoticePage | A page of the guest’s inbox, newest first. |
CrmNoticesReadBody | The notices the guest has seen, or all of them. |
crmDefaultNoticePage | A page of the inbox by default, and the most one page may be. |
crmMaxNoticePage | |
crmMaxNoticesRead | The most notices one read may name. |
crmMaxPushTokenBytes | The longest registration token PurrCRM keeps. |
CrmConsent
Section titled “CrmConsent”class CrmConsentWhat PurrCRM keeps of the guest’s choices about its pushes.
Members of CrmConsent
Section titled “Members of CrmConsent”CrmConsent.fromJson()
Section titled “CrmConsent.fromJson()”factory CrmConsent.fromJson(Map<String, Object?> json)CrmConsent()
Section titled “CrmConsent()”const CrmConsent({bool offersByPush = false})offersByPush
Section titled “offersByPush”final bool offersByPushA marketing push goes only to a guest who agreed.
CrmConsentBody
Section titled “CrmConsentBody”class CrmConsentBodyWhat the guest chose in the host’s own screens about PurrCRM’s pushes. Only what is sent changes.
Members of CrmConsentBody
Section titled “Members of CrmConsentBody”CrmConsentBody.fromJson()
Section titled “CrmConsentBody.fromJson()”factory CrmConsentBody.fromJson(Map<String, Object?> json)CrmConsentBody()
Section titled “CrmConsentBody()”const CrmConsentBody({bool? offersByPush})offersByPush
Section titled “offersByPush”final bool? offersByPushThe guest agreeing to offers by push, or null to leave it.
toJson
Section titled “toJson”Map<String, Object?> toJson()CrmDeviceBody
Section titled “CrmDeviceBody”class CrmDeviceBodyThe device the host’s Firebase gave a registration token for, which the package registers on every start and whenever the token changes.
Members of CrmDeviceBody
Section titled “Members of CrmDeviceBody”CrmDeviceBody.fromJson()
Section titled “CrmDeviceBody.fromJson()”factory CrmDeviceBody.fromJson(Map<String, Object?> json)CrmDeviceBody()
Section titled “CrmDeviceBody()”const CrmDeviceBody({required String token, required CrmPushPlatform platform, String appVersion = '', String locale = ''})appVersion
Section titled “appVersion”final String appVersionWhat the app is and speaks, for staff to tell devices apart.
locale
Section titled “locale”final String localeplatform
Section titled “platform”final CrmPushPlatform platformfinal String tokentoJson
Section titled “toJson”Map<String, Object?> toJson()CrmExportDevice
Section titled “CrmExportDevice”class CrmExportDeviceOne device the guest registered for pushes, in their export, without its token.
Members of CrmExportDevice
Section titled “Members of CrmExportDevice”CrmExportDevice.fromJson()
Section titled “CrmExportDevice.fromJson()”factory CrmExportDevice.fromJson(Map<String, Object?> json)CrmExportDevice()
Section titled “CrmExportDevice()”const CrmExportDevice({required CrmPushPlatform platform, required DateTime createdAt, required DateTime lastSeenAt, String appVersion = '', String locale = ''})appVersion
Section titled “appVersion”final String appVersioncreatedAt
Section titled “createdAt”final DateTime createdAtlastSeenAt
Section titled “lastSeenAt”final DateTime lastSeenAtlocale
Section titled “locale”final String localeplatform
Section titled “platform”final CrmPushPlatform platformCrmExportNotice
Section titled “CrmExportNotice”class CrmExportNoticeOne notice in the guest’s inbox, in their export.
Members of CrmExportNotice
Section titled “Members of CrmExportNotice”CrmExportNotice.fromJson()
Section titled “CrmExportNotice.fromJson()”factory CrmExportNotice.fromJson(Map<String, Object?> json)CrmExportNotice()
Section titled “CrmExportNotice()”const CrmExportNotice({required String type, required String title, required String body, required DateTime createdAt, String link = '', DateTime? readAt})final String bodycreatedAt
Section titled “createdAt”final DateTime createdAtfinal String linkreadAt
Section titled “readAt”final DateTime? readAtfinal String titlefinal String typeCrmForgetDeviceBody
Section titled “CrmForgetDeviceBody”class CrmForgetDeviceBodyThe token the package registered, forgotten as the guest signs out so that the next guest on the phone is not pushed the last one’s.
Members of CrmForgetDeviceBody
Section titled “Members of CrmForgetDeviceBody”CrmForgetDeviceBody.fromJson()
Section titled “CrmForgetDeviceBody.fromJson()”factory CrmForgetDeviceBody.fromJson(Map<String, Object?> json)CrmForgetDeviceBody()
Section titled “CrmForgetDeviceBody()”const CrmForgetDeviceBody({required String token})final String tokentoJson
Section titled “toJson”Map<String, Object?> toJson()CrmNoticePage
Section titled “CrmNoticePage”class CrmNoticePageA page of the guest’s inbox, newest first.
Members of CrmNoticePage
Section titled “Members of CrmNoticePage”CrmNoticePage.fromJson()
Section titled “CrmNoticePage.fromJson()”factory CrmNoticePage.fromJson(Map<String, Object?> json)CrmNoticePage()
Section titled “CrmNoticePage()”const CrmNoticePage({List<CrmNotice> notices = const <CrmNotice>[], int unread = 0, String nextBefore = ''})nextBefore
Section titled “nextBefore”final String nextBeforeThe notice to ask for older ones before; empty on the last page.
notices
Section titled “notices”final List<CrmNotice> noticesunread
Section titled “unread”final int unreadThe whole inbox’s unread count, not this page’s: the bell’s number.
CrmNoticesReadBody
Section titled “CrmNoticesReadBody”class CrmNoticesReadBodyThe notices the guest has seen, or all of them.
Members of CrmNoticesReadBody
Section titled “Members of CrmNoticesReadBody”CrmNoticesReadBody.fromJson()
Section titled “CrmNoticesReadBody.fromJson()”factory CrmNoticesReadBody.fromJson(Map<String, Object?> json)CrmNoticesReadBody()
Section titled “CrmNoticesReadBody()”const CrmNoticesReadBody({List<String> ids = const <String>[], bool all = false})final bool allfinal List<String> idstoJson
Section titled “toJson”Map<String, Object?> toJson()crmDefaultNoticePage
Section titled “crmDefaultNoticePage”const int crmDefaultNoticePageA page of the inbox by default, and the most one page may be. The Go constants are DefaultNoticePage and MaxNoticePage.
crmMaxNoticePage
Section titled “crmMaxNoticePage”const int crmMaxNoticePageNo description.
crmMaxNoticesRead
Section titled “crmMaxNoticesRead”const int crmMaxNoticesReadThe most notices one read may name. The Go constant is MaxNoticesRead.
crmMaxPushTokenBytes
Section titled “crmMaxPushTokenBytes”const int crmMaxPushTokenBytesThe longest registration token PurrCRM keeps. The Go constant is MaxPushTokenBytes.