Giter VIP home page Giter VIP logo

gettingstarted-swift-sdk-tutorial's Introduction

Tutorial: Getting Started Developing a Chat app with the Swift SDK (iOS)

Simple chat app to demonstrate the basic principles of creating a chat app with PubNub. This app is written in Swift, targeting iOS and uses Swift UI for the user interface.

PubNub allows you to create chat apps from scratch or add them to your existing applications. You can focus on creating the best user experience while PubNub takes care of scalability, reliability, security, and global legislative compliance.

Create 1:1 private chat rooms, group chats, or mega chats for large scale events, for a variety of use cases.

For the sake of simplicity, this application will only focus on a single 'group chat' room

Screenshot

Demo

This application is not available on the app store but can be built and run locally in a simulator (or multiple simulators to show chat between multiple participants)

Features

  • Publish and Subscribe for messages with the PubNub Swift SDK
  • Use Presence APIs to determine who is currently chatting
  • The Message Persistence API will retrieve past messages for users newly joining the chat
  • Assign a 'friendly name' to yourself which will be available to others via the PubNub App Context storage APIs

Installing / Getting Started

To run this project yourself you will need a PubNub account

Requirements

PubNub Signup

Get Your PubNub Keys

  1. You’ll first need to sign up for a PubNub account. Once you sign up, you can get your unique PubNub keys from the PubNub Developer Portal.

  2. Sign in to your PubNub Dashboard.

  3. Click Apps, then Create New App.

  4. Give your app a name, and click Create.

  5. Click your new app to open its settings, then click its keyset.

  6. Enable the Presence feature for your keyset. Also tick the box for 'Presence Deltas'

  7. Enable the Stream Controller feature for your keyset.

  8. Enable the Message Persistence feature for your keyset

  9. Enable the App Context feature for your keyset. Also enable 'user metadata events'

  10. Copy the Publish and Subscribe keys and paste them into your app as specified in the next step.

Building and Running

  • Clone the Github repository

git clone https://github.com/PubNubDevelopers/GettingStarted-Swift-SDK-Tutorial.git

  • Navigate to the application directory

cd GettingStarted-Swift-SDK-Tutorial

  • Add your pub/sub keys to PubNubConstants.swift

  • Open the application in Xcode and run on device or with a simulator. Use multiple devices / simulators to give a more realistic chat experience.

Contributing

Please fork the repository if you'd like to contribute. Pull requests are always welcome.

Links

Checkout the following links for more information on developing chat solutions with PubNub:

gettingstarted-swift-sdk-tutorial's People

Contributors

darryncampbell-pubnub avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.