This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void init() { | |
InputStream inputStream = .getResources().openRawResource(R.raw.json); | |
Writer writer = new StringWriter(); | |
char[] buffer = new char[1024]; | |
try { | |
Reader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); | |
int n; | |
while ((n = reader.read(buffer)) != -1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SimpleChatFragment extends QiscusChatFragment { | |
public static SimpleChatFragment newInstance(QiscusChatRoom qiscusChatRoom) { | |
SimpleCustomChatFragment fragment = new SimpleCustomChatFragment(); | |
Bundle bundle = new Bundle(); | |
bundle.putParcelable(CHAT_ROOM_DATA, qiscusChatRoom); | |
fragment.setArguments(bundle); | |
return fragment; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def self.create_jwt_token(user, request = nil) | |
begin | |
if user.kind_of?(Integer) | |
user_id = user | |
elsif user.kind_of?(User) | |
user_id = user.id | |
else | |
raise Exception.new("Parameter must be an user or user id.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is example JWT auth token using Rails on Ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qiscus.buildGroupChatRoomWith("channel") | |
.build() | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(new Action1<QiscusChatRoom>() { | |
@Override | |
public void call(QiscusChatRoom qiscusChatRoom) { | |
startActivity(QiscusChatActivity.generateIntent(MainActivity.this, qiscusChatRoom)); | |
} | |
}, new Action1<Throwable>() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global $, QiscusSDK */ | |
$(document).ready(function () { | |
QiscusSDK.core.init({ | |
AppId: 'sdksample', | |
mode: 'wide', | |
options: { | |
avatar: false, | |
loginSuccessCallback: function () { | |
loadRoomList(); | |
checkOnlinePresence(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StickerChatAdapter extends QiscusChatAdapter { | |
private static final int TYPE_STICKER_ME = 23323; | |
private static final int TYPE_STICKER_OTHER = 23324; | |
public StickerChatAdapter(Context context, boolean groupChat) { | |
super(context, groupChat); | |
} | |
@Override | |
protected int getItemViewTypeCustomMessage(QiscusComment qiscusComment, int position) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1: In `settings.gradle` copy paste the following code: | |
```bash | |
include 'project-name' | |
project(':project-name').projectDir = new File('project path') | |
``` | |
Step 2: In your `builde.gradle` copy paste the following code, your project-name module: | |
```bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Editors | |
.vscode/ | |
.idea/ | |
# Vagrant | |
.vagrant/ | |
# Mac/OSX | |
.DS_Store |