@dineengine/flybuy-capacitor
v0.2.4
Published
Utilizes Flybuy SDKs to provide native functionality to Capacitor apps
Downloads
73
Readme
@dineengine/flybuy-capacitor
Utilizes Flybuy SDKs to provide native functionality to Capacitor apps
Install
npm install @dineengine/flybuy-capacitor
npx cap sync
iOS
Add the following to your Info.plist:
<dict>
...
<key>DEFlyBuyToken</key>
<string>[APP_TOKEN]</string>
...
</dict>
Add the following to your AppDelegate:
import FlyBuy
import FlyBuyPickup
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Other setup
FlyBuy.Core.configure(["token": "TOKEN_HERE"])
FlyBuyPickup.Manager.shared.configure()
return true
}
Android
Generate a key for Maps SDK for Android and add the following to your AndroidManifest.xml:
<application>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="<INSERT_API_KEY>"/>
</application>
<!-- FlyBuy -->
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.POST_NOTIFICATION" />
<uses-permission
android:name="android.permission.INSTANT_APP_FOREGROUND_SERVICE"
tools:ignore="ProtectedPermissions" />
Add the following to your strings.xml:
<string name="de_flybuy_token">[APP_TOKEN]</string>
Add the following to your MainActivity:
FlyBuyCore.configure(this.getApplication(), this.getResources().getString(R.string.de_flybuy_token));
PickupManager.Companion.getInstance(null).configure(this.getApplication());
NotifyManager.Companion.getInstance(null).configure(this.getApplication());
API
getCurrentCustomer()
getSiteByPartnerID(...)
createOrder(...)
updateCustomerState(...)
createCustomer(...)
registerForPushNotifications(...)
- Interfaces
- Enums
getCurrentCustomer()
getCurrentCustomer() => Promise<{ customer: Customer | null; }>
Returns: Promise<{ customer: Customer | null; }>
getSiteByPartnerID(...)
getSiteByPartnerID(options: { id: string; }) => Promise<{ site: Site; }>
| Param | Type |
| ------------- | ---------------------------- |
| options
| { id: string; } |
Returns: Promise<{ site: Site; }>
createOrder(...)
createOrder(options: { siteID: number; partnerIdentifier: string; customerInfo: CustomerInfo; pickupWindow: PickupWindow; pickupType: PickUpType; }) => Promise<{ order: Order; }>
| Param | Type |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| options
| { siteID: number; partnerIdentifier: string; customerInfo: CustomerInfo; pickupWindow: PickupWindow; pickupType: PickUpType; } |
Returns: Promise<{ order: Order; }>
updateCustomerState(...)
updateCustomerState(options: { orderID: number; customerState: CustomerState; }) => Promise<{ order: Order; }>
| Param | Type |
| ------------- | -------------------------------------------------------------------------------------------- |
| options
| { orderID: number; customerState: CustomerState; } |
Returns: Promise<{ order: Order; }>
createCustomer(...)
createCustomer(options: { customerInfo: CustomerInfo; termsOfService: boolean; ageVerification: boolean; }) => Promise<{ customer: Customer; }>
| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------------------------------------- |
| options
| { customerInfo: CustomerInfo; termsOfService: boolean; ageVerification: boolean; } |
Returns: Promise<{ customer: Customer; }>
registerForPushNotifications(...)
registerForPushNotifications(options: { token: string; }) => Promise<void>
| Param | Type |
| ------------- | ------------------------------- |
| options
| { token: string; } |
Interfaces
Customer
| Prop | Type |
| ------------------ | ----------------------------------------------------- |
| emailAddress
| string |
| id
| number |
| info
| CustomerInfo |
| registered
| boolean |
| token
| string |
CustomerInfo
| Prop | Type |
| ------------------ | ------------------- |
| carColor
| string |
| carType
| string |
| licensePlate
| string |
| name
| string |
| phone
| string |
Site
| Prop | Type |
| ---------------------------- | ----------------------------------------------------- |
| country
| string |
| coverPhotoURL
| string |
| descriptionText
| string |
| fullAddress
| string |
| geofence
| Geofence |
| id
| number |
| instructions
| string |
| latitude
| string |
| locality
| string |
| longitude
| string |
| name
| string |
| operationalStatus
| string |
| partnerIdentifier
| string |
| phone
| string |
| pickupConfig
| PickupConfig |
| postalCode
| string |
| projectAccentColor
| string |
| projectAccentTextColor
| string |
| projectLogoURL
| string |
| region
| string |
| streetAddress
| string |
| wrongSiteArrivalRadius
| number |
Geofence
| Prop | Type |
| ------------------ | ------------------- |
| latitude
| string |
| longitude
| string |
| radiusMeters
| number |
PickupConfig
| Prop | Type |
| -------------------------------- | ------------------------------- |
| accentColor
| string |
| accentTextColor
| string |
| askToAskImageURL
| string |
| availablePickupTypes
| PickupTypeConfig[] |
| customerNameEditingEnabled
| boolean |
| id
| number |
| pickupTypeSelectionEnabled
| boolean |
| privacyPolicyURL
| string |
| termsOfServiceURL
| string |
| type
| string |
PickupTypeConfig
| Prop | Type |
| ------------------------------- | -------------------- |
| pickupType
| string |
| pickupTypeLocalizedString
| string |
| requireVehicleInfo
| boolean |
| showVehicleInfoFields
| boolean |
Order
| Prop | Type |
| -------------------------------------------------- | ----------------------------------------------------- |
| completedAt
| Date |
| createdAt
| Date |
| curbsideLocalizedString
| string |
| customerCarColor
| string |
| customerCarType
| string |
| customerComment
| string |
| customerID
| number |
| customerLicensePlate
| string |
| customerName
| string |
| customerRating
| string |
| customerState
| string |
| displayName
| string |
| distanceFilteringDisabled
| boolean |
| etaAt
| Date |
| id
| number |
| isLocationTrackingEnabled
| boolean |
| partnerIdentifier
| string |
| partnerIdentifierForCrew
| string |
| partnerIdentifierForCustomer
| string |
| pickupLocalizedString
| string |
| pickupType
| string |
| pickupWindow
| PickupWindow |
| projectAccentColor
| string |
| projectAccentTextColor
| string |
| projectLogoURL
| string |
| projectMobileFlowAlwaysShowVehicleInfoFields
| boolean |
| projectMobileFlowCustomerNameEditingEnabled
| boolean |
| projectMobileFlowPickupTypeSelectionEnabled
| boolean |
| projectMobileFlowRequireVehicleInfoIfVisible
| boolean |
| pushToken
| string |
| redeemedAt
| Date |
| redemptionCode
| string |
| siteBeaconRegions
| BeaconRegion[] |
| siteCountry
| string |
| siteCoverPhotoURL
| string |
| siteDescription
| string |
| siteFullAddress
| string |
| siteID
| number |
| siteInstructions
| string |
| siteLatitude
| string |
| siteLocality
| string |
| siteLongitude
| string |
| siteName
| string |
| sitePartnerIdentifier
| string |
| sitePhone
| string |
| sitePickupConfig
| PickupConfig |
| sitePostalCode
| string |
| siteRegion
| string |
| siteStreetAddress
| string |
| spotIdentifier
| string |
| spotIdentifierEntryEnabled
| boolean |
| spotIdentifierInputType
| string |
| state
| string |
| updatedAt
| Date |
| wrongSiteDetectionEnabled
| boolean |
| wrongSiteSearchRadius
| number |
Date
Enables basic storage and retrieval of dates and times.
| Method | Signature | Description | | ---------------------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- | | toString | () => string | Returns a string representation of a date. The format of the string depends on the locale. | | toDateString | () => string | Returns a date as a string value. | | toTimeString | () => string | Returns a time as a string value. | | toLocaleString | () => string | Returns a value as a string value appropriate to the host environment's current locale. | | toLocaleDateString | () => string | Returns a date as a string value appropriate to the host environment's current locale. | | toLocaleTimeString | () => string | Returns a time as a string value appropriate to the host environment's current locale. | | valueOf | () => number | Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. | | getTime | () => number | Gets the time value in milliseconds. | | getFullYear | () => number | Gets the year, using local time. | | getUTCFullYear | () => number | Gets the year using Universal Coordinated Time (UTC). | | getMonth | () => number | Gets the month, using local time. | | getUTCMonth | () => number | Gets the month of a Date object using Universal Coordinated Time (UTC). | | getDate | () => number | Gets the day-of-the-month, using local time. | | getUTCDate | () => number | Gets the day-of-the-month, using Universal Coordinated Time (UTC). | | getDay | () => number | Gets the day of the week, using local time. | | getUTCDay | () => number | Gets the day of the week using Universal Coordinated Time (UTC). | | getHours | () => number | Gets the hours in a date, using local time. | | getUTCHours | () => number | Gets the hours value in a Date object using Universal Coordinated Time (UTC). | | getMinutes | () => number | Gets the minutes of a Date object, using local time. | | getUTCMinutes | () => number | Gets the minutes of a Date object using Universal Coordinated Time (UTC). | | getSeconds | () => number | Gets the seconds of a Date object, using local time. | | getUTCSeconds | () => number | Gets the seconds of a Date object using Universal Coordinated Time (UTC). | | getMilliseconds | () => number | Gets the milliseconds of a Date, using local time. | | getUTCMilliseconds | () => number | Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). | | getTimezoneOffset | () => number | Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). | | setTime | (time: number) => number | Sets the date and time value in the Date object. | | setMilliseconds | (ms: number) => number | Sets the milliseconds value in the Date object using local time. | | setUTCMilliseconds | (ms: number) => number | Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). | | setSeconds | (sec: number, ms?: number | undefined) => number | Sets the seconds value in the Date object using local time. | | setUTCSeconds | (sec: number, ms?: number | undefined) => number | Sets the seconds value in the Date object using Universal Coordinated Time (UTC). | | setMinutes | (min: number, sec?: number | undefined, ms?: number | undefined) => number | Sets the minutes value in the Date object using local time. | | setUTCMinutes | (min: number, sec?: number | undefined, ms?: number | undefined) => number | Sets the minutes value in the Date object using Universal Coordinated Time (UTC). | | setHours | (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number | Sets the hour value in the Date object using local time. | | setUTCHours | (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number | Sets the hours value in the Date object using Universal Coordinated Time (UTC). | | setDate | (date: number) => number | Sets the numeric day-of-the-month value of the Date object using local time. | | setUTCDate | (date: number) => number | Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). | | setMonth | (month: number, date?: number | undefined) => number | Sets the month value in the Date object using local time. | | setUTCMonth | (month: number, date?: number | undefined) => number | Sets the month value in the Date object using Universal Coordinated Time (UTC). | | setFullYear | (year: number, month?: number | undefined, date?: number | undefined) => number | Sets the year of the Date object using local time. | | setUTCFullYear | (year: number, month?: number | undefined, date?: number | undefined) => number | Sets the year value in the Date object using Universal Coordinated Time (UTC). | | toUTCString | () => string | Returns a date converted to a string using Universal Coordinated Time (UTC). | | toISOString | () => string | Returns a date as a string value in ISO format. | | toJSON | (key?: any) => string | Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. |
PickupWindow
| Prop | Type |
| ----------- | ------------------------------------- |
| end
| Date |
| start
| Date |
BeaconRegion
| Prop | Type |
| ----------- | ------------------- |
| major
| number |
| minor
| number |
| uuid
| string |
Enums
PickUpType
| Members | Value |
| ---------------- | ------------------------- |
| CURBSIDE
| 'curbside' |
| PICKUP
| 'pickup' |
| DELIVERY
| 'delivery' |
| DISPATCH
| 'dispatch' |
| DRIVE_THRU
| 'drive_thru' |
CustomerState
| Members | Value |
| --------------- | ------------------------ |
| CREATED
| 'created' |
| EN_ROUTE
| 'en_route' |
| NEARBY
| 'nearby' |
| ARRIVED
| 'arrived' |
| WAITING
| 'waiting' |
| DEPARTED
| 'departed' |
| COMPLETED
| 'completed' |