Tapslash

The Tapslash Developer Hub

Welcome to the Tapslash developer hub. Here you'll find comprehensive guides and documentation to help you start working with the SDK(s) as quickly as possible, as well as support if you get stuck slong the way. Let's jump right in!

Get Started    

Local Services

In addition to the services Slash provides, developers can also add custom, local services using the Slash SDK. To add a local service, follow the steps below:

1) Add a new local service on the Slash Platform (recommended)

OR

Create a service in the slash_services.json file and set the type property set to local.

    {
      "search_placeholder": "Share your photos", 
      "precache_icon": "slash_photos.png", 
      "search_enabled": false, 
      "app_order": 0, 
      "slash": "photos", 
      "image_baricon": "http://s3.amazonaws.com/slash-media-staging/services/baricon/30aacabc0b6b3a566cead9b056c7387273663239.png", 
      "type": "local", 
      "id": 36
    }

2) Register the local service(s). This ensures that if a local service is added to the dashboard, it will only show up on the Slash toolbar if the client is registered to handle that service in order to avoid versioning issues. Registering local services must be done before sync is called.

Slash.shared.registerLocalServices(services: ["photos"])

3) Subclass SLKSlashView and override configureLocalService:

    override func configureLocalService(service: SLKService) {
        super.configureLocalService(service: service)
        
        if service.name == "myservice" {
            // Implement local service logic here
        }
    }

In the sample project, we have provided an example of how to implement a custom photos service in the SKInputViewController, which replaces the keyboard when active.

    public func configureWithPhotos() {
        let status: SLKAuthorizationStatus = SLKPermissionManager.isPhotosEnabled()
        if status == .authorized {
            self.photosView = SLKPhotosView()
            self.photosView?.delegate = self
            self.replaceKeyboard(view: self.photosView)
        } else {
            self.permissionView = SLKPermissionView()
            self.permissionView?.configure(type: .photo, status: status)
            self.replaceKeyboard(view: self.permissionView)
        }
    }

Local Services