Swiftpack.co -  Michaelsafir/Yelm.Server as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Michaelsafir/Yelm.Server
Service for working with the API Yelm - mobile application builder. Allows you to access any data and create orders. All algorithms are available for free
.package(url: "https://github.com/Michaelsafir/Yelm.Server.git", from: "1.0.10")

## Start SDK

How to use the SDK to create applications based on Yelm Media.

Thanks to our development you can create a commercial application and manage it through a panel at beta.yelm.io

To get started, configure the server operation

Use the start method and pass your platform and user position. The platform is your internal application identifier, the position is passed in the form of coordinates to determine the availability of goods and this or that position.

ServerAPI.start(platform: "5fd33466e17963.29052139", position: position) {
  (result) in

  // result - Returns a Bool - if everything was successful
  
}

Transmit the position strictly in parameter format - as shown in the example

let position = UserDefaults.standard.string(forKey: "SELECTED_SHOP_POINTS") ?? "lat=0&lon=0"

To work with the SDK during testing - we recommend using debug - toggle its state and you can see what sends

ServerAPI.settings.debug = false

Obtaining the settings of the application

To get the application settings - initialize the get_settings method after a successful SDK start

ServerAPI.settings.get_settings {
    (load) in
    if (load) {
      // Here you can use the resulting settings
    }
}

What settings do we have ?

public var theme : String = "" // HEX color of app 
public var foreground : String = "" // HEX color for the text on top of the theme
public var symbol : String = "" // Currency sign for your region
public var currency : String = "" // Currency code for your region
public var debug : Bool = false // You know.

User registration in the system

To register a user, use the registration method. This method will give you a unique user each time you access it - save his login for future accesses.

ServerAPI.user.registration {
    (load, user) in
    if (load) {
        // user 
        UserDefaults.standard.set(user, forKey: "USER")
    }
}

For the rest of the data, see wiki page

Logs

Send to the server information about the user action to display statistics

ServerAPI.settings.log(action: "open_news_notification", about: "\(object.id)")

open_item
share_item
share_news
open_item_search
open_story
open_news
open_item_from_news
open_item_subcategory
open_item_chat
open_order_history
open_app
close_app
open_load

GitHub

link
Stars: 2
Last commit: 3 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

1.0.10
3 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API