0.2.3 • Published 2 years ago

@dineengine/flybuy-capacitor v0.2.3

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 years ago

@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()

getCurrentCustomer() => Promise<{ customer: Customer | null; }>

Returns: Promise<{ customer: Customer | null; }>


getSiteByPartnerID(...)

getSiteByPartnerID(options: { id: string; }) => Promise<{ site: Site; }>
ParamType
options{ id: string; }

Returns: Promise<{ site: Site; }>


createOrder(...)

createOrder(options: { siteID: number; partnerIdentifier: string; customerInfo: CustomerInfo; pickupWindow: PickupWindow; pickupType: PickUpType; }) => Promise<{ order: Order; }>
ParamType
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; }>
ParamType
options{ orderID: number; customerState: CustomerState; }

Returns: Promise<{ order: Order; }>


createCustomer(...)

createCustomer(options: { customerInfo: CustomerInfo; termsOfService: boolean; ageVerification: boolean; }) => Promise<{ customer: Customer; }>
ParamType
options{ customerInfo: CustomerInfo; termsOfService: boolean; ageVerification: boolean; }

Returns: Promise<{ customer: Customer; }>


registerForPushNotifications(...)

registerForPushNotifications(options: { token: string; }) => Promise<void>
ParamType
options{ token: string; }

Interfaces

Customer

PropType
emailAddressstring
idnumber
infoCustomerInfo
registeredboolean
tokenstring

CustomerInfo

PropType
carColorstring
carTypestring
licensePlatestring
namestring
phonestring

Site

PropType
countrystring
coverPhotoURLstring
descriptionTextstring
fullAddressstring
geofenceGeofence
idnumber
instructionsstring
latitudestring
localitystring
longitudestring
namestring
operationalStatusstring
partnerIdentifierstring
phonestring
pickupConfigPickupConfig
postalCodestring
projectAccentColorstring
projectAccentTextColorstring
projectLogoURLstring
regionstring
streetAddressstring
wrongSiteArrivalRadiusnumber

Geofence

PropType
latitudestring
longitudestring
radiusMetersnumber

PickupConfig

PropType
accentColorstring
accentTextColorstring
askToAskImageURLstring
availablePickupTypesPickupTypeConfig[]
customerNameEditingEnabledboolean
idnumber
pickupTypeSelectionEnabledboolean
privacyPolicyURLstring
termsOfServiceURLstring
typestring

PickupTypeConfig

PropType
pickupTypestring
pickupTypeLocalizedStringstring
requireVehicleInfoboolean
showVehicleInfoFieldsboolean

Order

PropType
completedAtDate
createdAtDate
curbsideLocalizedStringstring
customerCarColorstring
customerCarTypestring
customerCommentstring
customerIDnumber
customerLicensePlatestring
customerNamestring
customerRatingstring
customerStatestring
displayNamestring
distanceFilteringDisabledboolean
etaAtDate
idnumber
isLocationTrackingEnabledboolean
partnerIdentifierstring
partnerIdentifierForCrewstring
partnerIdentifierForCustomerstring
pickupLocalizedStringstring
pickupTypestring
pickupWindowPickupWindow
projectAccentColorstring
projectAccentTextColorstring
projectLogoURLstring
projectMobileFlowAlwaysShowVehicleInfoFieldsboolean
projectMobileFlowCustomerNameEditingEnabledboolean
projectMobileFlowPickupTypeSelectionEnabledboolean
projectMobileFlowRequireVehicleInfoIfVisibleboolean
pushTokenstring
redeemedAtDate
redemptionCodestring
siteBeaconRegionsBeaconRegion[]
siteCountrystring
siteCoverPhotoURLstring
siteDescriptionstring
siteFullAddressstring
siteIDnumber
siteInstructionsstring
siteLatitudestring
siteLocalitystring
siteLongitudestring
siteNamestring
sitePartnerIdentifierstring
sitePhonestring
sitePickupConfigPickupConfig
sitePostalCodestring
siteRegionstring
siteStreetAddressstring
spotIdentifierstring
spotIdentifierEntryEnabledboolean
spotIdentifierInputTypestring
statestring
updatedAtDate
wrongSiteDetectionEnabledboolean
wrongSiteSearchRadiusnumber

Date

Enables basic storage and retrieval of dates and times.

MethodSignatureDescription
toString() => stringReturns a string representation of a date. The format of the string depends on the locale.
toDateString() => stringReturns a date as a string value.
toTimeString() => stringReturns a time as a string value.
toLocaleString() => stringReturns a value as a string value appropriate to the host environment's current locale.
toLocaleDateString() => stringReturns a date as a string value appropriate to the host environment's current locale.
toLocaleTimeString() => stringReturns a time as a string value appropriate to the host environment's current locale.
valueOf() => numberReturns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
getTime() => numberGets the time value in milliseconds.
getFullYear() => numberGets the year, using local time.
getUTCFullYear() => numberGets the year using Universal Coordinated Time (UTC).
getMonth() => numberGets the month, using local time.
getUTCMonth() => numberGets the month of a Date object using Universal Coordinated Time (UTC).
getDate() => numberGets the day-of-the-month, using local time.
getUTCDate() => numberGets the day-of-the-month, using Universal Coordinated Time (UTC).
getDay() => numberGets the day of the week, using local time.
getUTCDay() => numberGets the day of the week using Universal Coordinated Time (UTC).
getHours() => numberGets the hours in a date, using local time.
getUTCHours() => numberGets the hours value in a Date object using Universal Coordinated Time (UTC).
getMinutes() => numberGets the minutes of a Date object, using local time.
getUTCMinutes() => numberGets the minutes of a Date object using Universal Coordinated Time (UTC).
getSeconds() => numberGets the seconds of a Date object, using local time.
getUTCSeconds() => numberGets the seconds of a Date object using Universal Coordinated Time (UTC).
getMilliseconds() => numberGets the milliseconds of a Date, using local time.
getUTCMilliseconds() => numberGets the milliseconds of a Date object using Universal Coordinated Time (UTC).
getTimezoneOffset() => numberGets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).
setTime(time: number) => numberSets the date and time value in the Date object.
setMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using local time.
setUTCMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
setSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using local time.
setUTCSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using Universal Coordinated Time (UTC).
setMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using local time.
setUTCMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using Universal Coordinated Time (UTC).
setHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hour value in the Date object using local time.
setUTCHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hours value in the Date object using Universal Coordinated Time (UTC).
setDate(date: number) => numberSets the numeric day-of-the-month value of the Date object using local time.
setUTCDate(date: number) => numberSets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
setMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using local time.
setUTCMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using Universal Coordinated Time (UTC).
setFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year of the Date object using local time.
setUTCFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year value in the Date object using Universal Coordinated Time (UTC).
toUTCString() => stringReturns a date converted to a string using Universal Coordinated Time (UTC).
toISOString() => stringReturns a date as a string value in ISO format.
toJSON(key?: any) => stringUsed by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

PickupWindow

PropType
endDate
startDate

BeaconRegion

PropType
majornumber
minornumber
uuidstring

Enums

PickUpType

MembersValue
CURBSIDE'curbside'
PICKUP'pickup'
DELIVERY'delivery'
DISPATCH'dispatch'
DRIVE_THRU'drive_thru'

CustomerState

MembersValue
CREATED'created'
EN_ROUTE'en_route'
NEARBY'nearby'
ARRIVED'arrived'
WAITING'waiting'
DEPARTED'departed'
COMPLETED'completed'
0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago