React Native FlyBuy module. Supports Core, Pickup, Notify, and Presence Native SDK APIs.

Overview

The FlyBuy cloud service and mobile SDK enables developers to add FlyBuy functionality directly into their react native apps for a full white label implementation of the service.

This library was bootstrapped with create-react-native-module

Documentation

Visit react-native-bildit-flybuy to view the full documentation.

Contributing

Do you have a feature request, bug report, or patch? Great! See CONTRIBUTING.md for information on what you can do about that. Contributions are welcome and appreciated !

License

MIT

Comments
  • release build issue in library

    release build issue in library

    @zeabdelkhalek - can you please take a look at it.

    Able to successfully do debug build. having issue on release builds with the latest version. below is the error am seeing in flybuy.swift class in the library.

    react-native-bildit-flybuy: 0.2.3 xcode:13.1, react-native: 0.64.2,

    Error: ....../node_modules/react-native-bildit-flybuy/ios/Flybuy.swift:1:8: error: no such module 'FlyBuy' import FlyBuy

    PhaseScriptExecution [CP]\ Copy\ XCFrameworks /Users/{username}/Library/Developer/Xcode/DerivedData/BannerMobile-fdxxocqnhtdhaffemfuunwlhvzdq/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/react-native-bildit-flybuy.build/Script-5909969872634610556DC56C809DD899.sh (in target 'react-native-bildit-flybuy' from project 'Pods') cd /Users/{username}/Desktop/Projects/banner-mobile/ios/Pods /bin/sh -c @@/Users/{username}/Library/Developer/Xcode/DerivedData/BannerMobile-fdxxocqnhtdhaffemfuunwlhvzdq/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/react-native-bildit-flybuy.build/Script-5909969872634610556DC56C809DD899.sh

    warning: [CP] Unable to find matching .xcframework slice in 'ios-arm64 ios-arm64_x86_64-simulator' for the current build architectures (arm64 x86_64 i386). warning: [CP] Unable to find matching .xcframework slice in 'ios-arm64 ios-arm64_x86_64-simulator' for the current build architectures (arm64 x86_64 i386). warning: [CP] Unable to find matching .xcframework slice in 'ios-arm64_x86_64-simulator ios-arm64' for the current build architectures (arm64 x86_64 i386). warning: [CP] Unable to find matching .xcframework slice in 'ios-arm64 ios-arm64_x86_64-simulator' for the current build architectures (arm64 x86_64 i386).

    opened by seewah48 12
  • Type Error

    Type Error

    Getting this error:

    TypeError: _reactNativeBilditFlybuy.default.Pickup.onPermissionChanged is not a function. (In '_reactNativeBilditFlybuy.default.Pickup.onPermissionChanged()', '_reactNativeBilditFlybuy.default.Pickup.onPermissionChanged' is undefined)

    waiting user response 
    opened by mohanenm 7
  • create order does function does not support pickup type, pickup window, and order state, optionally

    create order does function does not support pickup type, pickup window, and order state, optionally

    The Flybuy SDK has the ability to set pickup type, pickup window, and order state, but they are not required. In the example app, if you do not send a pickup window, pickup type, and order state you get an error such as: Screen Shot 2022-01-20 at 6 20 58 PM

    I can go into the create orders call and have this work as expected by changing the behavior in the swift function, but it would be nice to have this behavior built-in.

    Further, with the current swift methods, there is no way to create an ASAP order. Even if I explicitly edit both start and end, the pickup window is caught in func decodePickupWindow(pickupWindow: Dictionary<String, String>?) -> PickupWindow because it is expecting a date.

    Making the pickup window actually optional in the framework would solve this by allowing us to leave it out and have it set to ASAP.

    cc: @AT89

    opened by mohanenm 7
  • Implement FlyBuy SDK 2.6.1

    Implement FlyBuy SDK 2.6.1

    What's New:

    • Support FlyBuy SDK 2.6.1
    • Add support for Creating Order using Site Partner Identifier
    • Add new types: PickupConfig and PickupTypeConfig

    Breaking Change:

    • createOrder function now only need one parameter and it's a object. Before:

          FlyBuy.Core.Orders.createOrder(
             SITE_ID,
             NEW_PID,
             CUSTOMER_INFO
          )
      

      Now:

          FlyBuy.Core.Orders.createOrder({
             siteId: SITE_ID,
             pid: NEW_PID,
             customerInfo: CUSTOMER_INFO
          })
      
    opened by addingama 3
  • Optional pickup type not being sent

    Optional pickup type not being sent

    The 2.2.3 IOS Flybuy SDK supports sending a pickup type, optionally. Currently, none of the swift methods actually send it through.

    I was able to accomplish this(and still support the others optional params) by implementing this with the example app:

        func createOrder(siteId: Int,
                         pid: String,
                         customerInfo: Dictionary<String, String>,
                         pickupWindow: Dictionary<String, String>? = nil,
                         orderState: String? = nil,
                         pickupType: String? =  nil,
                         resolve:@escaping RCTPromiseResolveBlock,
                         reject:@escaping RCTPromiseRejectBlock) {
            let info = decodeCustomerInfo(customer: customerInfo)
    
            func callbackHandler(order: Order?, error: Error?) {
                        if (error == nil && order != nil) {
                            resolve(self.parseOrder(order: order!))
                        } else {
                            reject(error.debugDescription, error?.localizedDescription, error )
                        }
                    }
            if (pickupWindow != nil) {
                      let pickupWindowInfo = decodePickupWindow(pickupWindow: pickupWindow)
                      FlyBuy.Core.orders.create(siteID: siteId, partnerIdentifier: pid, customerInfo: info, pickupWindow: pickupWindowInfo, state: orderState ?? "created", pickupType: pickupType ?? "") {
                          (order, error) in callbackHandler(order: order, error: error)
                      }
            } else if (pickupWindow == nil) {
                FlyBuy.Core.orders.create(siteID: siteId, partnerIdentifier: pid, customerInfo: info, state: orderState ?? "created", pickupType: pickupType ?? "") {
                        (order, error) in callbackHandler(order: order, error: error)
                    }
            }
        }
    
    opened by mohanenm 2
  • example app build failure

    example app build failure

    Reopening example app build failure issue

    @mohanenm If you clone this repository and you want to run the example app, you have just to run it directly without the need of running yarn add react-native-bildit-flybuy because it's integrated there in the Podfile

    Originally posted by @zeabdelkhalek in https://github.com/BILDIT-Platform/react-native-bildit-flybuy/issues/15#issuecomment-970247296

    @zeabdelkhalek though this is confusing. The project stills fail in Xcode because it cannot locate the pods. If I try to disintegrate and install, I get...

    Invalid Podfile file: cannot load such file -- /Users/{username}/Desktop/react-native-bildit-flybuy/example-app/node_modules/react-native/scripts/react_native_pods.

    because node_modules does not exist.

    So how would I run it without generating the node modules first?

    If I run npm install generate the node modules, I get:

    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR! 
    npm ERR! While resolving: [email protected]
    npm ERR! Found: [email protected]
    npm ERR! node_modules/react
    npm ERR!   react@"16.13.1" from the root project
    npm ERR!   peer react@">=16.13.1" from [email protected]
    npm ERR!   node_modules/react-native-permissions
    npm ERR!     react-native-permissions@"^3.0.4" from the root project
    npm ERR!   1 more (react-native)
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer react@"17.0.2" from [email protected]
    npm ERR! node_modules/react-native-windows
    npm ERR!   peer react-native-windows@">=0.62.0" from [email protected]
    npm ERR!   node_modules/react-native-permissions
    npm ERR!     react-native-permissions@"^3.0.4" from the root project
    npm ERR! 
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    

    I can force it or allow legacy deps, but the project app still does not build.

    opened by mohanenm 2
  • Multiple Dependencies with different sources

    Multiple Dependencies with different sources

    Currently trying to build the example app in this repo and running into this error when trying to run pod install from the IOS folder, after running yarn add react-native-bildit-flybuy from the root folder.

    [!] There are multiple dependencies with different sources for `react-native-bildit-flybuy` in `Podfile`:
    
    - react-native-bildit-flybuy (from `../node_modules/react-native-bildit-flybuy`)
    - react-native-bildit-flybuy (from `../..`)
    

    I am using:

    xcode: 13.1 react native: 0.63 bilidt wrapper: 0.2.3

    I have already tried cloning a new project, deintegrating and attempting to install pods again, remove node_modules, all to no avail.

    opened by mohanenm 2
  • Problem with method Flybuy.Core.Orders.fetchOrderByRedemptionCode on iOS

    Problem with method Flybuy.Core.Orders.fetchOrderByRedemptionCode on iOS

    For some orders the Flybuy.Core.Orders.fetchOrderByRedemptionCode on iOS returns the following error: [Error: We're having trouble finding this order. Contact the store for additional details about your order.]

    For the same redemptionCode method is working correctly on Android.

    Here is example order which I used to reproduce this error: { "customerLicensePlate": "", "siteDescription": "Belk Athens, GA at Georgia Square Mall near West Atlanta Hwy", "siteInstructions": "For Contactless Curbside Pickup, look for the yellow Store Pickup flags nearest our entrance on the Front side facing Zaxby's. Drive into one of our designated parking spaces. Let us know you’re here, and we’ll be right out. For In Store Pickup, park anywhere outside our entrance on the Front side facing Zaxby's. Look for our yellow Store Pickup flags. Come inside to the Free Store Pickup Counter near the Ladies' Department where we'll have your order waiting!", "siteLongitude": "-83.467764", "customerCarColor": "", "siteName": "Athens, GA", "siteFullAddress": "Georgia Square Mall, 3700-175 Atlanta Hwy, Athens, GA 30606", "redeemedAt": "2021-06-30T17:42:31.815Z", "redemptionCode": "9NRNEEYMW7", "pickupType": "curbside", "siteID": 17851, "pickupWindow": [ "null", "null" ], "siteLatitude": "33.943315", "customerState": "en_route", "customerCarType": "", "partnerIdentifier": "7014", "state": "ready", "customerName": "MJ", "siteCoverPhotoURL": null, "customerComment": null, "sitePhone": "+17063530060", "etaAt": "2021-07-01T15:18:51.797Z", "id": 50803066 }

    opened by mjosipovic 2
  • Listen to order events in JS

    Listen to order events in JS

    Hi, thanks for the repository! 👍

    Currently we have no way to listen when an order was updated in JS side.

    We was using this snippet to dispatch events to JS and want to know if this makes sense to you to add it here too

    enum FlyBuySupportedEvents: String, CaseIterable {
        case ordersUpdated = "ordersUpdated";
        case ordersError = "ordersError";
        case orderUpdated = "orderUpdated";
        case orderEventError = "orderEventError";
    }
    
    class Flybuy: RCTEventEmitter {
        // ...
        func startObserving() {
            NotificationCenter.default.addObserver(forName: .orderUpdated, object: nil, queue: nil) { (notification) in
                if let order = notification.object as? Order {
                    let event = FlyBuySupportedEvents.orderUpdated.rawValue
                    let body = self.parseOrder(order: order)
                    self.sendEvent(withName: event, body: body)
                }
            }
        }
    
        func stopObserving() {
            NotificationCenter.default.removeObserver(self)
        }
    
        deinit {
            self.removeAllObservers()
        }
    }
    
      private fun startObserving() {
        val orderObserver = Observer<List<Order>> {
          orderProgress(it)
        }
    
        GlobalScope.launch(Dispatchers.Main) {
          (currentActivity as AppCompatActivity).let {
            FlyBuy.orders.openLiveData.observe(it, orderObserver)
          }
        }
      }
    
      private fun orderProgress(orders: List<Order>) {
        orders.forEach { order ->
          reactApplicationContext
            .getJSModule(RCTDeviceEventEmitter::class.java)
            .emit("orderUpdated", parseOrder(order))
        }
      }
    
      private fun stopObserving() {
        (currentActivity as AppCompatActivity?)?.let {
          if (FlyBuy.orders.openLiveData.hasObservers()) {
            FlyBuy.orders.openLiveData.removeObservers(it)
          }
        }
      }
    
    enhancement in progress 
    opened by euharrison 2
  • Add Send Spot Identifier wrapper

    Add Send Spot Identifier wrapper

    @zeabdelkhalek I've added the wrapper for the new function and updated the development app.

    Can you help me update the SDK version to the latest?

    I've tried to update the android version to 2.3.1 but it always failed.

    opened by addingama 1
  • example app - warning: Could not find or use auto-linked library

    example app - warning: Could not find or use auto-linked library

    Run into this issue every time I try and build.

    Error output from Xcode build:
    ** BUILD FAILED **
    
    Xcode’s output:
    ↳
    ** ld: warning: Could not find or use auto-linked library ‘swiftSwiftOnoneSupport’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftObjectiveC’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftCoreFoundation’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftCompatibility50’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftDarwin’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftUIKit’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftQuartzCore’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftCore’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftCoreGraphics’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftCompatibility51’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftFoundation’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftCoreImage’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftCompatibilityDynamicReplacements’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftMetal’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftDispatch’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftCoreMedia’**
    ** ld: warning: Could not find or use auto-linked library ‘swiftCoreAudio’**
    
    opened by mohanenm 1
  • Support for version 2.6 of the Flybuy SDK

    Support for version 2.6 of the Flybuy SDK

    opened by mohanenm 2
  • Support for version 2.4.1 of the Flybuy SDK

    Support for version 2.4.1 of the Flybuy SDK

    • Adds support for BGAppRefreshTask to improve syncing on iOS 13 and higher. See Notify SDK Documentation for details on using this.
    • Support for "Defer on Pickup" Notify campaigns
    opened by mohanenm 7
Releases(v1.0.1)
  • v1.0.1(Sep 13, 2022)

    What's New:

    • Support FlyBuy SDK 2.6.1
    • Add support for Creating Order using Site Partner Identifier
    • Add new types: PickupConfig and PickupTypeConfig

    Breaking Change:

    • createOrder function now only need one parameter and it's a object. Before:

          FlyBuy.Core.Orders.createOrder(
             SITE_ID,
             NEW_PID,
             CUSTOMER_INFO
          )
      

      Now:

          FlyBuy.Core.Orders.createOrder({
             siteId: SITE_ID,
             pid: NEW_PID,
             customerInfo: CUSTOMER_INFO
          })
      
    Source code(tar.gz)
    Source code(zip)
  • v0.4.11(Jun 17, 2022)

    • Add official documentation link on the footer (#41) (46a72f56)
    • Add Background task support on notify configure (b85e2ec0)
    • Add FlyBuy iOS SDK version 2.5.2 (b8b59336)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.9(Feb 24, 2022)

  • v0.4.8(Feb 18, 2022)

    • Merge pull request #32 from BILDIT-Platform/bug/31-pickup-type (e8b653e7)
    • Remove unused overloaded functions (5d64a5b3)
    • Pass down pickupType on create order (ef4edded)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.7(Feb 9, 2022)

  • v0.4.6(Feb 9, 2022)

    • Adds partnerIdentifierForCustomer and partnerIdentifierForCrew to order response (4fd01795)
    • Merge pull request #29 from BILDIT-Platform/example_app_update (992d43e1)
    • update example app (3a1e66c1)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.5(Jan 26, 2022)

    • Merge pull request #28 from BILDIT-Platform/update-for-release (b7a6a3ef)
    • Update development xcode (dbe535da)
    • Update function parameter definition (daf07b71)
    • Merge pull request #27 from BILDIT-Platform/create-order-overload (adff60b8)
    • Reformat createOrder function call to support missing parameters (89d4d528)
    • Allow null values to be passed down to createOrder function (4631f52b)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.4(Jan 13, 2022)

  • v0.4.3(Dec 20, 2021)

    • Notify Background Data Refresh Wrapper
    • Wrap Handle Notification Response function from SDK
    • Add Send Spot Identifier wrapper
    • Update Native iOS and Android SDK
    Source code(tar.gz)
    Source code(zip)
  • v0.1(Jun 8, 2021)

Owner
BILDIT, LLC.
BILDIT, LLC.
iOS 13-compatible backports of commonly used async/await-based system APIs that are only available from iOS 15 by default.

AsyncCompatibilityKit Welcome to AsyncCompatibilityKit, a lightweight Swift package that adds iOS 13-compatible backports of commonly used async/await

John Sundell 367 Jan 5, 2023
Venice - Coroutines, structured concurrency and CSP for Swift on macOS and Linux.

Venice provides structured concurrency and CSP for Swift. Features Coroutines Coroutine cancelation Coroutine groups Channels Receive-only chan

Zewo 1.5k Dec 22, 2022
Make your logic flow and data flow clean and human readable

Flow What's Flow Flow is an utility/ design pattern that help developers to write simple and readable code. There are two main concerns: Flow of opera

null 18 Jun 17, 2022
Extensions and additions to AsyncSequence, AsyncStream and AsyncThrowingStream.

Asynchone Extensions and additions to AsyncSequence, AsyncStream and AsyncThrowingStream. Requirements iOS 15.0+ macOS 12.0+ Installation Swift Packag

Red Davis 101 Jan 6, 2023
straightforward networking and error handling with async-await and URLSession

AsyncAwaitNetworkingPlayground How To Run Just clone the project, open it and run. Some notes about AsyncAwaitNetworkingPlayground It's a straightforw

Fırat Yenidünya 17 Dec 11, 2022
Slack message generator and API client, written in Swift with Result Builders and Concurrency

Slack Message Client This package provides a Swift object model for a Slack Block Kit message, as well as a Result Builder convenience interface for e

Mike Lewis 2 Jul 30, 2022
Automatically generate GraphQL queries and decode results into Swift objects, and also interact with arbitrary GitHub API endpoints

GitHub API and GraphQL Client This package provides a generic GitHub API client (GithubApiClient) as well as Codable-like GitHub GraphQL querying and

Mike Lewis 4 Aug 6, 2022
A complete set of primitives for concurrency and reactive programming on Swift

A complete set of primitives for concurrency and reactive programming on Swift 1.4.0 is the latest and greatest, but only for Swift 4.2 and 5.0 use 1.

AsyncNinja 156 Aug 31, 2022
GroupWork is an easy to use Swift framework that helps you orchestrate your concurrent, asynchronous functions in a clean and organized way

GroupWork is an easy to use Swift framework that helps you orchestrate your concurrent, asynchronous functions in a clean and organized way. This help

Quan Vo 42 Oct 5, 2022
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).

Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD). It allows you to create any asynchronous and synchronous task easily, all managed by a queue, with just a few lines.

Fabrizio Brancati 1k Dec 2, 2022
SwiftCoroutine - Swift coroutines for iOS, macOS and Linux.

Many languages, such as Kotlin, Go, JavaScript, Python, Rust, C#, C++ and others, already have coroutines support that makes the async/await pattern i

Alex Belozierov 808 Dec 1, 2022
SwiftyTimer allows you to instantly schedule delays and repeating timers using convenient closure syntax. It's time to get rid of Objective-C cruft.

SwiftyTimer Modern Swifty API for NSTimer SwiftyTimer allows you to instantly schedule delays and repeating timers using convenient closure syntax. It

Radek Pietruszewski 1.2k Dec 27, 2022
A demonstration for bridging between Combine and your new async functions

CombineAsyncually This is a DEMONSTRATION of how you can bridge the new async / await functionality in Swift 5.5 with Combine. There is NO WARRANTY. T

null 48 Dec 4, 2022
Queues, timers, and task groups in Swift

Dispatcher eases the pain of using Grand Central Dispatch by introducing 4 new Swift classes. Dispatcher Queue Group Timer Requirements Swift 2.0+ Ins

Alec Larson 109 Jan 29, 2022
Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch (iOS7+ and OS X 10.9+ compatible)

Async.legacy Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch (GCD) Async rewritten for iOS7 and OS X 10.9 Compatibility

Joseph Lord 31 Jul 1, 2019
A Swift DSL that allows concise and effective concurrency manipulation

NOTE Brisk is being mothballed due to general incompatibilities with modern version of Swift. I recommend checking out ReactiveSwift, which solves man

Jason Fieldman 25 May 24, 2019
⚡️ Fast async task based Swift framework with focus on type safety, concurrency and multi threading

Our apps constantly do work. The faster you react to user input and produce an output, the more likely is that the user will continue to use your appl

Said Sikira 814 Oct 30, 2022
Job Scheduler for IOS with Concurrent run, failure/retry, persistence, repeat, delay and more

SwiftQueue Schedule tasks with constraints made easy. SwiftQueue is a job scheduler for iOS inspired by popular android libraries like android-priorit

Lucas Nelaupe 367 Dec 24, 2022
A general purpose embedded hierarchical lock manager used to build highly concurrent applications of all types. Same type of locker used in many of the large and small DBMSs in existence today.

StickyLocking StickyLocking is a general purpose embedded lock manager which allows for locking any resource hierarchy. Installable Lock modes allow f

Sticky Tools 2 Jun 15, 2021