Android sample-chat app: Can not create chatroom (group chat) - quickblox

I have got the Android sample-chat app from the latest master release (quickblox-android-sdk-master) running but I can not create a new Chatroom from the app. If I create a chatroom by logging into my account on the quickblox site and creating a chatroom for my application then the chatroom shows up and the app works fine.
The application I am developing needs to create its own chatroom so I need the similar feature of the sample-chat app to create a new chatroom.
When I debug the sample-chat app I see that the code below is called:
#Override
public void onCreatedRoom(QBChatRoom room) {
Log.d(TAG, "room was created");
chatRoom = room;
chatRoom.addMessageListener(this);
}
with a valid QBChatRoom value. But the room does not show up in the app. Also when i log into my quickblox account and look into the app, there is no chatroom created.
Please let me know if there is a problem with the sample-chat app or the android sdk or if there is something special I need to do to create a chatroom. Thanks.

Seems like you create temporary chat rooms (not persistent).
Temporary room - A room that is destroyed if the last occupant exits
Try to create persistent room
Use
QBChatService.getInstance().createRoom(roomName, false, true, this);
instead of
QBChatService.getInstance().createRoom(roomName, false, false, this);

Related

How to offer full app download link from app clip

How to offer the full app once user is done with app clip action?
In the following screenshot from What's new in App Clips WWDC 2022 video, once the users are done ordering food, they are given option to download the full app.
Is there a specific UI configuration to use?
From the What's new in App Clips WWDC 2022.
Is it possible to customize the download banner?
Say remove the Get the full app?
Screenshot from 2020 video.
With UIKit, refer to recommending your app to App Clip users with SKOverlay and SKOverlayAppClipConfiguration object.
With SwiftUI, appStoreOverlay() could be used to provide the download option.
Note: To find the App Identifier go to the AppStoreConnect.apple.com -> General -> App Information and locate Apple Id (An automatically generated ID assigned to your app.).
Use it to trigger the AppStoreOverlay.
struct ContentView: View {
#State private var showRecommended = false
var body: some View {
Button("Show Recommended App") {
showRecommended.toggle()
}
.appStoreOverlay(isPresented: $showRecommended) {
SKOverlay.AppConfiguration(appIdentifier: "1440611372", position: .bottom)
}
}
}
Credits: How to recommend another app using appStoreOverlay()

Can I modify expo push notification title/body before showing the notification?

I'm using expo notification service.
I would like to send keys from backend, e.g.
{
title: "TITLE_KEY",
body: "BODY_KEY"
}
then translate it when it comes on the mobile side (based on the key), before showing it, so user would not see the key on notification, just the translated text...
So the question is how could I modify notification before showing it to the user?

React Native Expo app how to unregister from Notifications

In my react native expo app I am successfully registering to the notification service with Notifications.getExpoPushTokenAsync() and it is working without issue, my question is, how do I stop receiving notifications? Is there a way to clear the push token on the device only?
The problem I am having is if a user logs out and a different user logs in on the same device, they will still receive the previous users notifications since the device still is still registered. Notifications.removePushTokenSubscription() seemed like it may work but it only removes the push token listener created with Notifications.addPushTokenListener() which (I think) is unrelated to this issue
My current logout function attempt looks like this:
const logOutUser = async(notificationToken) => {
if(notificationToken){
var subscription = await Notifications.addPushTokenListener(notificationToken);
await Notifications.removePushTokenSubscription(subscription);
}
}
Am I thinking about this problem wrong? Thanks!
You can't unregistered from Notifications, there is no function that does that simply because the expo token is related to your device,not your account, instead you can do this:
When user login you should send the expo token to your back end
and store it in an array of expoTokens, because user can have his
account open in multiple phones.
Store the expo token in your
AsyncStorage.
When the user logout you should delete the expo token from array of expoTokens array in your Backend Database.
and finely delete it from AsyncStorage .
Hope it works for you!

Getting total unread notification count in Tizen and opening notification app on Gear 2

I am trying to add a notifications feature to my watchface.
I want to get total count of notifications on the Samsung Gear 2 and then when a specific areais clicked I would like to take the user to the "Notifications" app of the Samsung Gear.
Is this possible ?
How ?
Thanks.
At the moment Notification Web API is not available in wearable SDK. So you can't.
To launch application you have to know ID. There is example in documentation:
tizen.application.launch(ApplicationId id, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
or:
tizen.application.launchAppControl(
appControl,
appId,
function() {console.log("launch application control succeed"); },
function(e) {console.log("launch application control failed. reason: " + e.message); },
appControlReplyCallback );
You can find information in Tizen SDK help:
API References > Device API Reference > Application
and
Programming Guide > Device API Guides > Application Guides
You need the permission: http://tizen.org/privilege/application.launch
I want to launch "com.samsung.wnotification2". How ?
anybody who could help me to launch this ?
I hope you've found an answer already, though let me post an answer as I am stumbling into your question for fifth time ;)
var notificationsAppId = "com.samsung.wnotification2";
tizen.application.launch(notificationsAppId, function() {
console.log("launch success");
}, function() {
console.log("launch failed");
});
Please also take into account that this method of calling notifications screen will not work for Gear S - Samsung disabled ability to launch the "com.samsung.wnotification2" (though, if you try, the launch request will not indicate failure!)

Drag and drop to Spotify app icon

I'm making a Spotify app and I want to be able to drop something onto the app icon. There are examples of dropping things to the app, but how do I get the icon to react to dropping?
Adding the event listener
models.application.addEventListener('dropped', function() {
doSomething();
});
doesn't seem to do it. Other apps have it though, so there is a way.
You need to add the AcceptedLinkTypes attribute to the manifest.json file of your Spotify app.
For instance, if your app wants to react to drag&drop of playlists, you would do:
{
"AcceptedLinkTypes": ["playlist"],
...
}
Currently, album, artist, playlist, track and user are supported.
If the changes in AcceptedLinkTypes don't take any effect, try restarting the client.