Giter Site home page Giter Site logo

gappein / gappein-chat-sdk Goto Github PK

View Code? Open in Web Editor NEW
164.0 6.0 16.0 2.47 MB

A plug and play modular toolkit for integrating the Chat feature on top of Firebase!

License: Other

Kotlin 100.00%
firebase android library kotlin chat chat-sdk gappein-sdk

gappein-chat-sdk's Introduction

Gappein

Download Chat Download UI

Gappein is a new Chat SDK in town!

A plug and play modular toolkit for integrating the Chat feature on top of Firebase!

To check for detail documentation Click here

Table of contents

Get Started

(Back to top) To get started you need to first create a Firebase project for your app and add the google-service.json file in your project.

Installation

(Back to top)

Add the dependencies to the build.gradle

implementation "com.gappein.sdk:gappein-sdk:1.0.0-beta3"

Initialization

(Back to top)

Initialize the Gappein SDK with one line.

Gappein.initialize(context)

If you want to Gif integration Initialize the Gappein SDK with one line. Get the API Key from Giphy and use it like,

Gappein.initialize(context,"API_KEY")

Set the User by passing information about the currently logged in user

Gappein.getInstance().setUser(
         User(
                token = "user_token",
                profileImageUrl = "link_to_image",
                name = "user_name" 
            ), token = "user_token", {
             //Handle onSuccess
            }, {
             //Handle onError
            }
        )

UI

(Back to top)

You can either build your own UI or use our UI SDK to create a beautiful chat experience. To use our UI SDK add the following to your app's build.gradle -

implementation "com.gappein.sdk:gappein-ui:1.0.0-beta3"

To open the Channel List Fragment add the following code -

private fun addChannelListFragment() {
        val fm = supportFragmentManager
        val ft = fm.beginTransaction()
        ft.add(R.id.container,ChannelListFragment.newInstance())
        ft.commit()
    }

To open the Chat between two users, use the following code -

startActivity(MessageListActivity.buildIntent(this,"channel_id",User))

where User is the recipient user of the device.

Developer Notes

(Back to top)

This SDK is in alpha release, we would love to hear your feedback. If you face any issues please let us know here

Sample App

(Back to top)

Find the Demo App here

Contributing

(Back to top)

Your contributions are always welcome! Please have a look at the contribution guidelines first. ๐ŸŽ‰

License

(Back to top)

The MIT License (MIT) 2020. Please have a look at the LICENSE.md for more details.

gappein-chat-sdk's People

Contributors

asdheeraj avatar darshanclevertap avatar dheeraj-dd avatar hi-manshu avatar palcodes avatar patilshreyas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gappein-chat-sdk's Issues

Exception coming while initializing the sdk

Gappein.initialize(context)

Passing the correct context but getting crash

java.lang.NoSuchMethodError: No static method configure$default(Lcom/giphy/sdk/ui/Giphy;Landroid/content/Context;Ljava/lang/String;ZILjava/lang/Object;)V in class Lcom/giphy/sdk/ui/Giphy; or its super classes (declaration of 'com.giphy.sdk.ui.Giphy' appears in /data/app/com.jayant.proactivists-fKgc1ssPU4eabSvaoxdOGw==/base.apk)

Group Chat

While using Gappein, we can use to create groups and work on it.
Initial point to start,

  • In the FirebaseDataManagerImpl, where we use getOrCreateNewChatChannels function, we have to update to pass list of participant user tokens

Build error caused by the package named `interface`

Faced the problem using the Gappin UI library in a project.

Here is the output:

path/activities/MainActivity.java:72: error: <identifier> expected
public final class MainActivity extends androidx.appcompat.app.AppCompatActivity implements com.gappein.sdk.ui.view.channelview.interface.OnChannelClick {
                                                                                                                                  ^
path/activities/MainActivity.java:72: error: illegal start of type
public final class MainActivity extends androidx.appcompat.app.AppCompatActivity implements com.gappein.sdk.ui.view.channelview.interface.OnChannelClick {
                                                                                                                                           ^
path/activities/MainActivity.java:72: error: ';' expected
public final class MainActivity extends androidx.appcompat.app.AppCompatActivity implements com.gappein.sdk.ui.view.channelview.interface.OnChannelClick {
                                                                                                                                                          ^
path/activities/MainActivity.java:75: error: illegal start of expression
    private android.content.Context mContext;
    ^
path/activities/MainActivity.java:76: error: illegal start of expression
    private androidx.drawerlayout.widget.DrawerLayout drawerLayout;
    ^
path/activities/MainActivity.java:77: error: illegal start of expression
    private android.widget.FrameLayout FlipButtonContainer;
    ^
path/activities/MainActivity.java:78: error: illegal start of expression
    private android.widget.FrameLayout audioButtonContainer;
    ^
path/activities/MainActivity.java:79: error: illegal start of expression
    private android.widget.ImageView FlipButton;
    ^
path/activities/MainActivity.java:80: error: illegal start of expression
    private android.widget.ImageView sendAudioButton;
    ^
path/activities/MainActivity.java:81: error: illegal start of expression
    private android.widget.ImageView moreButton;
    ^
path/activities/MainActivity.java:84: error: illegal start of expression
    private android.animation.AnimatorSet activeAnimetion;
    ^
path/activities/MainActivity.java:85: error: illegal start of expression
    private android.animation.AnimatorSet activeAnimetion2;
    ^
path/activities/MainActivity.java:86: error: illegal start of expression
    private android.animation.AnimatorSet activeAnimetionAudio;
    ^
path/activities/MainActivity.java:87: error: illegal start of expression
    private int activeAnimetionType = 0;
    ^
path/activities/MainActivity.java:88: error: illegal start of expression
    private android.widget.EditText taskEdit;
    ^
path/activities/MainActivity.java:89: error: illegal start of expression
    private boolean isPaused = false;
    ^
path/activities/MainActivity.java:90: error: illegal start of expression
    private final boolean forceShowFlipButton = false;
    ^
    ... 
**e: java.lang.IllegalStateException: failed to analyze: java.lang.IllegalStateException: processingEnv must not be null**
        at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:56)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:190)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:164)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:51)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:86)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1549)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
        at sun.rmi.transport.Transport$1.run(Transport.java:200)
        at sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
**Caused by: java.lang.IllegalStateException: processingEnv must not be null**
        at androidx.room.RoomProcessor.getSupportedOptions(RoomProcessor.kt:57)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.getSupportedOptions(incrementalProcessors.kt)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.createDependencyCollector(incrementalProcessors.kt:46)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.access$createDependencyCollector(incrementalProcessors.kt:23)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor$dependencyCollector$1.invoke(incrementalProcessors.kt:26)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor$dependencyCollector$1.invoke(incrementalProcessors.kt:23)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.getRuntimeType(incrementalProcessors.kt:72)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalAptCache.updateCache(IncrementalAptCache.kt:26)
        at org.jetbrains.kotlin.kapt3.base.incremental.JavaClassCacheManager.updateCache(cache.kt:22)
        at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:86)
        at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:34)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.runAnnotationProcessing(Kapt3Extension.kt:229)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:192)
        at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:100)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:108)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:118)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:93)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:526)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:90)
        at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:517)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:185)
        ... 23 more```

Support for automatic initialization of SDK on App startup

It's a great library and that's why I would like to suggest an improvement which can be done here in this SDK.

Proposed solution

  • Just like official Firebase SDK doesn't need manual initialization (as it's optional, we can do that but it's not needed). We can do the same here with the help of ContentProvider.
  • Whenever the app is launched, SDK will be automatically initialized on app startup.

Advantage

  • Developer won't need to call initialize() manually.

Reference:


I hope you'll find this suggestion helpful.

Notification

For integrating Notifications, we need to use the Firebase topics to get started with and handle the notifications there after.
Another way to do is to user Device to Device push.

Could not find com.giphy.sdk:ui:2.0.3.

Execution failed for task ':app:mergeDebugResources'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.giphy.sdk:ui:2.0.3.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/giphy/sdk/ui/2.0.3/ui-2.0.3.pom
- https://jcenter.bintray.com/com/giphy/sdk/ui/2.0.3/ui-2.0.3.pom
- https://jitpack.io/com/giphy/sdk/ui/2.0.3/ui-2.0.3.pom
Required by:
project :app
project :app > com.gappein.sdk:gappein-sdk:1.0.0-beta3
project :app > com.gappein.sdk:gappein-ui:1.0.0-beta3

Build.gradle i tried to add gify

// chat
implementation "com.gappein.sdk:gappein-sdk:1.0.0-beta3"
implementation "com.gappein.sdk:gappein-ui:1.0.0-beta3"
implementation 'com.giphy.sdk:ui:2.0.3'

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.