GithubHelp home page GithubHelp logo

swift-one-on-one-chat's Introduction

iOS Chat App Example

Read the full tutorial here:

>> Build a one-on-one iOS chat app with Swift

This example shows how to build an anonymous group chat with Swift:

Technology

This demo uses:

  • CometChatPro 2.0.7
  • Swift 5
  • Xcode 11.2.1 or Higher

Running the demo

To run the demo follow these steps:

  1. Head to CometChat Pro and create an account
  2. From the dashboard, create a new app called "Swift 1 on 1 Chat"
  3. Once created, click Explore
  4. Go to the API Keys tab and click Create API Key
  5. Create an API key called "Swift 1 on 1 Chat Key" with Full Access
  6. Download the repository here or by running https://github.com/cometchat-pro-tutorials/swift-one-on-one-chat.git.
  7. Navigate to project directory and use pod install command to install the pods and open CometChat.xcworkspace in Xcode. 6 Update the Constants in ChatService.swift with your newly-created app ID, API key and Region code.
  8. Run the app and login with one of the test users: superhero1, superhero2, superhero3, superhero4 or superhero5

Questions about running the demo? Open an issue. We're here to help ✌️

Useful links

swift-one-on-one-chat's People

Contributors

marinbenc avatar

Stargazers

adamroz avatar Rakhim Abdullayev avatar  avatar Tim Kersey avatar Jamone Kelly avatar Igor Zubkov avatar Toan Tran avatar Kyle Howells avatar Krzysztof Zabłocki avatar

Watchers

Anant Garg avatar James Cloos avatar  avatar

swift-one-on-one-chat's Issues

Error when running the app

How to reproduce:

  • Update ChatService.swift with my credentials
static let cometChatAPIKey = "efd23e7d6bf3a48d8ed57e60f4ca39d499eb4624"
static let cometChatAppID = "82843690cb8e71"
  • Run the app
  • Login as superhero1

Error:

The auth token superhero1_22b3f3ebcd41f6a481601c6e742b7a69926f2e13 does not exist. Please make sure you are logged in and have a valid auth token or try login again.
2019-09-17 14:46:18.602861-0600 CometChat[5198:3495144] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
 Stack:(
	0   Foundation                          0x000000011255252a _AssertAutolayoutOnAllowedThreadsOnly + 77
	1   Foundation                          0x0000000112552251 -[NSISEngine _optimizeWithoutRebuilding] + 61
	2   Foundation                          0x000000011255217f -[NSISEngine optimize] + 108
	3   Foundation                          0x000000011254d3a5 -[NSISEngine performPendingChangeNotifications] + 84
	4   UIKitCore                           0x000000011d70d2ba -[UIView(CALayerDelegate) _wantsReapplicationOfAutoLayoutWithLayoutDirtyOnEntry:] + 166
	5   UIKitCore                           0x000000011d70da01 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1481
	6   QuartzCore                          0x0000000113b25eae -[CALayer layoutSublayers] + 173
	7   QuartzCore                          0x0000000113b2ab88 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 396
	8   QuartzCore                          0x0000000113b36ee4 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 72
	9   QuartzCore                          0x0000000113aa63aa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 328
	10  QuartzCore                          0x0000000113add584 _ZN2CA11Transaction6commitEv + 608
	11  QuartzCore                          0x0000000113ade435 _ZN2CA11Transaction14release_threadEPv + 201
	12  libsystem_pthread.dylib             0x0000000114f326ab _pthread_tsd_cleanup + 551
	13  libsystem_pthread.dylib             0x0000000114f35655 _pthread_exit + 70
	14  libsystem_pthread.dylib             0x0000000114f3243a _pthread_wqthread_exit + 74
	15  libsystem_pthread.dylib             0x0000000114f31644 _pthread_wqthread + 472
	16  libsystem_pthread.dylib             0x0000000114f313fd start_wqthread + 13
)
2019-09-17 14:46:18.604548-0600 CometChat[5198:3495144] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
 Stack:(
	0   Foundation                          0x000000011255252a _AssertAutolayoutOnAllowedThreadsOnly + 77
	1   Foundation                          0x0000000112552251 -[NSISEngine _optimizeWithoutRebuilding] + 61
	2   Foundation                          0x000000011255217f -[NSISEngine optimize] + 108
	3   Foundation                          0x000000011254d3a5 -[NSISEngine performPendingChangeNotifications] + 84
	4   UIKitCore                           0x000000011d70dcc8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2192
	5   QuartzCore                          0x0000000113b25eae -[CALayer layoutSublayers] + 173
	6   QuartzCore                          0x0000000113b2ab88 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 396
	7   QuartzCore                          0x0000000113b36ee4 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 72
	8   QuartzCore                          0x0000000113aa63aa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 328
	9   QuartzCore                          0x0000000113add584 _ZN2CA11Transaction6commitEv + 608
	10  QuartzCore                          0x0000000113ade435 _ZN2CA11Transaction14release_threadEPv + 201
	11  libsystem_pthread.dylib             0x0000000114f326ab _pthread_tsd_cleanup + 551
	12  libsystem_pthread.dylib             0x0000000114f35655 _pthread_exit + 70
	13  libsystem_pthread.dylib             0x0000000114f3243a _pthread_wqthread_exit + 74
	14  libsystem_pthread.dylib             0x0000000114f31644 _pthread_wqthread + 472
	15  libsystem_pthread.dylib             0x0000000114f313fd start_wqthread + 13
)

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.