React native freshchat loading issue while implementing show Conversations - chat

I have installed the react-native fresh chat package and set up the initial configuration. So I need open the conversation widget on the app.
Freshchat.showConversations(conversationOptions);
I tried the above code to show conversation but I getting a widget with a loader inside it. Loader not stoping.
Please help to fix this issue. Thanks !!!!

I resolved this by adding:
var freshchatConfig = new FreshchatConfig(APP_ID, APP_KEY);
freshchatConfig.domain = "YOUR-DOMAIN";
freshchatConfig.teamMemberInfoVisible = true;
freshchatConfig.cameraCaptureEnabled = true;
freshchatConfig.gallerySelectionEnabled = true;
freshchatConfig.responseExpectationEnabled = true;
freshchatConfig.showNotificationBanner = true; //iOS only
freshchatConfig.notificationSoundEnabled = true; //iOS only
freshchatConfig.themeName = "CustomTheme.plist"; //iOS only
freshchatConfig.stringsBundle = "FCCustomLocalizable"; //iOS only
Freshchat.init(freshchatConfig);
Reference:
https://support.freshchat.com/support/solutions/articles/50000000467-freshdesk-messaging-react-native-sdk-integration-steps#Pre-Requisites%C2%A0

Related

Soundcloud API Get current track name without widget

Is it possible via the SoundCloud API to get the current playing trackname ? Via the widget it's ok but it will be better (UX point of view) if I could without.
I found nobody mention it, if you have an idea, you're welcome !
Thx
I'm currently looking to do the same thing. Seems that the only way to do it via the API is to use what they call "activities" : https://developers.soundcloud.com/docs/api/reference#activities
So you can have a list of all activities made by a user, which includes the listening of a track. But I assume the activity will appear in the list only once the music has been played, not while the music plays.
Has anyone already used that functionnality ?
Regards,
Seb
I coded this litlle script that bind DOM's updates but it's very tricky.
// Bind new song on the soundcloud player
$('.playbackSoundBadge').bind('DOMSubtreeModified', function(e){
track_info = e.target;
if(track_info.className.indexOf('sc-media-image') > -1){
thumb = track_info.querySelector('span');
if(thumb != null){
splitted_url = track_info.href.split(/\//);
playing.artist = splitted_url[3];
playing.trackname = splitted_url[4];
thumb = track_info.querySelector('span');
playing.thumbnail = standardizeThumb(thumb.style.backgroundImage);
toaster(playing);
}
}
});
// Toast factory
function toaster(playing){
// Is there already a toast ?
toast = document.getElementById('sc-toast');
if(toast == null){
toast = document.createElement('div');
toast.id = 'sc-toast';
document.body.appendChild(toast);
}else{
toast.innerHTML = '';
}
// Build our toast
thumb = document.createElement('img');
thumb.src = playing.thumbnail;
toast.appendChild(thumb);
wrapper = document.createElement('div');
wrapper.className = 'wrapper-text';
playing.artist = standardizeString(playing.artist);
playing.trackname = standardizeString(playing.trackname);
artist = document.createElement('h1');
artist.innerHTML = playing.artist;
trackname = document.createElement('h2');
trackname.innerHTML = playing.trackname;
wrapper.appendChild(artist);
wrapper.appendChild(trackname);
toast.appendChild(wrapper);
}

All Ionic dependencies not found

I am trying to write a ionic app based on the sidemenu basis. One view that I am creating is a login view on which the sidemenu should be deactivated. Therefore I need the dependency variable $ionicView.
This leads to the error
Unknown provider: $ionicViewProvider <- $ionicView <- LoginController
The same error appears when trying to access $ionicConfigProvider.
Login.module.js:
angular.module("Login", ['ionic']);
Login.Controller.js:
angular.module("Login")
.controller("LoginController", function($ionicSideMenuDelegate, $ionicView){
var thisRef = this;
thisRef.Username = "";
thisRef.Password = "";
$ionicView.beforeEnter(function() {
$ionicSideMenuDelegate.canDragContent(false);
});
$ionicView.beforeLeave(function(){
$ionicSideMenuDelegate.canDragContent(true);
});
});
i have the same problem with my ionic sidemenu app.
To fix this problem i followed the ionic documentation:
Ionic View
And update my ionic bundle version lib to the final version.
You can update in bower.json file, change the version to ionic-bower#1.3.1"
See this codepen to help you
<script src="//code.ionicframework.com/1.3.1/js/ionic.bundle.js"></script>
Code Pen
From what I conclude from the Ionic forum (http://forum.ionicframework.com/t/how-to-use-ionicview-with-ionic-nightly/13666), is that you don't inject $ionicView directly in your controller, but rather use it in your controller.
angular.module("Login")
.controller("LoginController", function($ionicSideMenuDelegate){
$scope.$on('$ionicView.beforeEnter', function() {
//Do whatever you want here
});
var thisRef = this;
thisRef.Username = "";
thisRef.Password = "";
$ionicView.beforeEnter(function() {
$ionicSideMenuDelegate.canDragContent(false);
});
$ionicView.beforeLeave(function(){
$ionicSideMenuDelegate.canDragContent(true);
});
});
Read the documentation on what is possible with $ionicView: http://ionicframework.com/docs/nightly/api/directive/ionView/ under 'View LifeCycle and Events'

Is it possible to interfere with or circumvent Google's GWT JS code generation?

I'm interested in using a static iframe instead of the dynamically one that is created by default.
var frameInjected;
function maybeInjectFrame(){
if (!frameInjected) {
frameInjected = true;
var iframe = $doc.createElement($intern_36);
iframe.src = $intern_37;
iframe.id = $intern_1;
iframe.style.cssText = $intern_38;
iframe.tabIndex = -1;
$doc.body.appendChild(iframe);
$stats && $stats({moduleName:$intern_1, sessionId:$sessionId, subSystem:$intern_2, evtGroup:$intern_8, millis:(new Date).getTime(), type:$intern_39});
iframe.contentWindow.location.replace(base + initialHtml);
}
}
Yes it is possible to customise GWT's JS generation. Research GWT linkers.

error when opening video in titanium

I've been working in Titanium appaccelerator and now I'm trying to open a video in it.
I've used the following code:
movieWindow.js
function displayVideo()
{
var window = Ti.UI.createWindow({
width:200,
height:300,
});
var activeMovie = Titanium.Media.createVideoPlayer({
url:"respigrandsoupir.mp4",
width:300,
height:200,
top:50,
left:50,
backgroundColor:'#0f0'
});
window.add(activeMovie);
activeMovie.play();
return window;
}
My video respigrandsoupir.mp4 is under the Resource folder. The problem is that when trying to run this method I get the following error:
[WARN] Exception in event callback. { expressionBeginOffset = 159;
expressionCaretOffset = 173;
expressionEndOffset = 191;
line = 12;
message = "Result of expression 'Titanium.Media' [undefined] is not an object.";
name = TypeError;
sourceId = 238167336;
sourceURL = "file://localhost/Users/adrian/Documents/Titanium%20Studio%20Workspace/La%20Pause/Resources/movieWindow.js";
}
Can one tell me where am I going wrong?
Thank you for your valuable answers, but Project->Clean solved my issue!
When you use a new object like Titanium.Media that you never used before, a clean is often required because Titanium builds a custom light version in the target folder.
If you don't clean, it will search in vain the widget in this folder.

alert handling in ui automation iphone app unable to cancel the option

system.logElementTree();
var target = UIATarget.localTarget();
target.onAlert = function onAlert(alert) {
UIALogger.logDebug("There was an alert!");
target.onAlert.buttons()["No"].tap({x:164,y:278});
return false;
even though no option is clicked systen not performing any action
Can anyone please help me ...
Instead of BamboOS suggestion which loops through various positions, you can try this inside your onAlert function:
alert.tapWithOptions({tapOffset:{x:0.5, y:0.6}});
This tap targets the middle of the UIAAlert (x:0.5) and 60% from top to bottom (y:0.6). This works when there is only one button. You have multiple buttons, then you have to changed the value of x. This works for me.
I just published a blog post regarding UI Automation and dealing with alerts:
http://www.conduce.net/Blog.aspx?f=Automated-Test-of-iPad-Apps
Basically following alert handler worked for me:
UIATarget.onAlert = function onAlert(alert){
var name = alert.name();
UIALogger.logMessage("alert "+name+" encountered");
if(name == "errorAlert"){
var positionX = 500;
for(var positionY=300; positionY<600;positionY+=10){
target.tap({x:positionX,y:positionY});
}
return true;
}
return false;
}
I would either use the "cancelButton" or "defaultButton" methods when handling alerts.