Firebase Root View Controller Not Found Warning - objective-c

I got a strange warning from Firebase Analytics today. It is:
<Warning> [Firebase/Analytics][I-ACS031011] Root view controller not found
The methods I am using is basically deleting a post and then displaying a status bar notification to the user that the post is deleted. This is the method that is called when we want to delete a post.
HomeViewNetwork.deletePost(postBlock: self.postDataBlock, handler: {
AlertManager.showStatusRed(title: "Post deleted!")
})
And my displaying status function is:
class func showStatusRed(title: String) {
let statusMessage = MessageView.viewFromNib(layout: .StatusLine)
var config = SwiftMessages.defaultConfig
config.presentationContext = .window(windowLevel: UIWindowLevelStatusBar)
statusMessage.configureContent(body: title)
statusMessage.backgroundView.backgroundColor = UIColor(red:0.98, green:0.11, blue:0.35, alpha:1.00)
setUpStatusView(messageView: statusMessage)
statusSwiftMessages.show(config: config, view: statusMessage)
}
The warning goes away if I comment the AlertManager.showStatusRed method. Also I am using SwiftMessages as my library for displaying the status bar notification.
I am not sure why Firebase is giving me this warning when Xcode is not giving any issues about root view controller. Any help is appreciated.
Related question for objective-C only project complied with Xcode 9 GM using FirebaseCore 4.0.4 (podfile.lock): Xcode 9 <Warning> [Firebase/Analytics][I-ACS031011] Root view controller not found

Updating the firebase and other related dependencies to latest version fixed the issue on my project.
- Firebase/Core (4.2.0):
- FirebaseAnalytics (= 4.0.3)
- FirebaseCore (= 4.0.7)
Answer on other thread: https://stackoverflow.com/a/46333312/342794

Related

Titanium evalJS slows loading of the webview - timeout waiting to evaluate js

I am developing Titanium application with a webview that is loading content from a remote url. In the load event I am injecting some code with evalJS. Using Titanium SDK 8.0.0+ the loading of the webview content is very slow because of evalJS, I need to wait for some time in order to scroll or click something. I can see in the console that there is a warning repeatedly saying "TiWebViewBinding: (main) [4405,4881] Timeout waiting to evaluate JS", and when this warning stops showing I can interact with the webview. If evalJS is not used meaning I am not injecting code, there is no problem. The webview is loaded properly and there is no warning saying "Timeout waiting to evaluate JS". Before 8.0.0 sdk the problem did not existed. Has anyone had an experience with an issue like this? Am I missing something?
I would be very grateful if I get some input on this. Thanks.
var webview = Ti.UI.createWebView({
width : Ti.UI.FILL,
height : Ti.UI.FILL,
url : "remote url"
});
webview.addEventListener('load', function() {
webview.evalJS('(function() {alert("test");})();');
webview.evalJS('(function sum(val1, val2){return val1 + val2;})();');
});
window.add(webview);
window.open();

branch io integration with Adobe air app issue

Our iOS app is live in iTunes, and we want to integrate it with Branch io. We can build the ipa for testing, but when we try to "Export Release Build", the Flash Builder 4.6 will hang.
This is the branch io guide that we are following:
https://dev.branch.io/getting-started/sdk-integration-guide/guide/adobe/
We just followed the steps, and put in the stuff up to step 4, where we called
branch.init() in the main class. The setting in branch io is setup ok.
here are the codes, (just copied from branch io's website)
// Then create a Branch instance:
var branch:Branch = new Branch();
// Register two events before initializing the SDK:
branch.addEventListener(BranchEvent.INIT_FAILED, initFailed);
branch.addEventListener(BranchEvent.INIT_SUCCESSED, initSuccessed);
private function initFailed(bEvt:BranchEvent):void {
trace("BranchEvent.INIT_FAILED", bEvt.informations);
}
private function initSuccessed(bEvt:BranchEvent):void {
trace("BranchEvent.INIT_SUCCESSED", bEvt.informations);
// params are the deep linked params associated with the link that the user clicked before showing up
// params will be empty if no data found
var referringParams:Object = JSON.parse(bEvt.informations);
//trace(referringParams.user);
}
// Initialize the SDK:
branch.init();
Any clues?

ionic3 open external url without address bar and toolbar and close button

My app needs a login page from external url.
The login logic that I thought is :
Steps
Open external url when ionic is launched
Once user logged in, move back to internal app using deep link (ex : myapp://main)
I tested step 2 which is deep link. Works well.
So, I have to make step 1 now.
First, I tested with iframe.
And got Refused to display 'https:....' in a frame because it set 'X-Frame-Options' to 'deny'. error. Seems this needs a server-side configuration. But anyway we don't want to use this way. iframe feels like a hack.
Second, I tried location.href = this.loginUrl;.
Worked well in chrome browser but when I built in iOS simulator, I see address bar, tool bar, and close button.
I don't like this because I don't want user to close login page or to change url address.
Third, tried window.open(this.loginUrl, '_self', 'location=no').
Same result as second.
Fourth, tried to use ionic version of in-app-browserplugin.
But the result is same as second and third.
It still opens a browser with address bar, tool bar even it shows 'back to myApp'. So user would feel this is out of app.
Check here, people are looking for the solution still.
After spending a day, I don't even know if there is option I can try.
I could resolve by doing this. But in real device.
Xcode iPhone emulators don't have open in-app-browser but built-in browser.
browser:any;
this.platform.ready().then(() => {
this.browser = this.iab.create(this.loginUrl, '_blank', 'location=no,toolbar=no');
});
You can solve this by installing a cordova plugin called cordova-plugin-inappbrowser. Execute the following commands:
ionic plugin add cordova-plugin-inappbrowser
npm install --save #ionic-native/in-app-browser
On your app.module.ts add
import { InAppBrowser } from '#ionic-native/in-app-browser';
and also add the following to your providers in app.module.ts
providers: [
StatusBar,
SplashScreen,
InAppBrowser,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
Then on your home.ts add
import { InAppBrowser } from '#ionic-native/in-app-browser';
and inject it into the constructor like this
constructor(public navCtrl: NavController, private iab: InAppBrowser) {
}
then add the following method
ionViewDidLoad(){
this.iab.create('url', '_self', { location: 'no' }); }
Check the different options you have for this plugin here
For removing the address bar just use the option:
location: Set to yes or no to turn the InAppBrowser's location bar on or off.

titanium ti.paint toimage() is returning {} after drawing on ios

the following code is resulting in to different outputs different android and ios. myBlob below is {} on ios - the image is empty even after drawing on the screen. in Android it an object with properties and is working fine, but iOS the image is always blank.
This was working before in past ios versions and builds so am I not building it right? We are using 5.3.0 GA for titanium SDK. I have the module checked for iOS in the TiApp Editor.
function uploadImage(signed) {
if (signed) {
var myBlob;
try {
myBlob = $.viewPaint.toImage();
var myImage = Titanium.Utils.base64encode(myBlob).toString();
$.nextAction.image = myImage;
} catch (ex) {
Titanium.API.error('FAILURE HANDLING SIGNATURE DOCUMENT: ' + ex);
return;
}
}
$.nextAction.perform(Alloy.Globals.requests);
}
Ti Paint Module for iPhone
#
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.4.0
apiversion: 2
architectures: armv7 i386 x86_64 arm64
description: Provides a paint surface user interface view.
author: Jeff Haynie
license: Appcelerator Commercial License
copyright: Copyright (c) 2010-2014 by Appcelerator, Inc.
# these should not be edited
name: paint
moduleid: ti.paint
guid: 43f13063-d426-4e9c-8a7a-72dc5e4aec57
platform: iphone
minsdk: 3.4.1.GA
prior code that adds execute to action object
var route = action.action.uri;
Ti.API.info('route = ' + route);
newAction.execute = function(requestManager) {
Titanium.App.fireEvent('app:index:view:requested',
controller : 'signscreen',
uri : route
});
};
code that fires the event to open:
Titanium.App.fireEvent('app:index:view:requested', {
controller : 'signature'
});
if you have anything in your view hierarchy that overlays your paintview such as a confirmation dialog or closing the view in a navigation controller and not grabbing your paintview prior to the window closing the paintview will always return empty. android will continue to work fine but ios will not as the view is not present in the view hierarchy.
Your console log value of {} is a red herring.
Tested on:
TiSDK 5.2.2.GA, 5.3.0.GA
ti.paint: 1.4.0, 1.4.1 (our version with fixes that have been ignored by appc)
With <run-on-main-thread>false</run-on-main-thread> in tiapp.xml
Using the example app.js from the module and adding the following:
var buttonSave = Ti.UI.createButton({ bottom:100, right:10, width:75, height:30, title:'Save' });
buttonSave.addEventListener('click', function(e){
var test = paintView.toImage();
console.log(test.length);
console.log(paintView.toImage());
var imageFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,"testing.png");
imageFile.write(paintView.toImage());
});
win.add(buttonSave)
You will find that
The logged value always will be {}
The length of the object you assigned toImage() to increases as you add pixels to your paintView
The image DOES get written to a file.

Titanium : How to load an external custom AlertDialog in Alloy?

I code all my project in Alloy, so no classic Titanium here.
I want to load an external custom AlertDialog (located in views/popup.xml) in my index. So my need is to show an alert and destroy it (for ie.) by clicking the OK button. The Help button should do another action.
My popup.xml file :
<Alloy>
<AlertDialog id="popup" title="Error popup"
message="There is an error" cancel="1">
<ButtonNames>
<ButtonName>OK</ButtonName>
<ButtonName>Help</ButtonName>
</ButtonNames>
</AlertDialog>
</Alloy>
My index.js file :
function openPopup(e) {
var page = Alloy.createController('views/popup').getView();
page.show();
};
openPopup();
But this gives me an error :
[DEBUG] [iphone, 8.1, 192.168.0.1] Native
module:alloy/controllers/views/popup
[ERROR] [iphone, 8.1, 192.168.0.1] Couldn't find module:
alloy/controllers/views/popup
[ERROR] [iphone, 8.1, 192.168.0.1] TypeError: 'undefined' is not a
constructor (evaluating 'new (__p.require("alloy/controllers/" +
name))(args)')
I have no popup.js and I didn't require any file in index.js too. So my questions are : How to load a controller dynamically? How to remove (or destroy) it with an addEventListener on "click" action? Thank you.
Agree with turtle. When you create a controller it implicitly knows you are referring to a view in the the app/views directory.
And you should improve your code slightly by not creating a local variable (for garbage collection purposes). So instead of:
var page = Alloy.createController('views/popup').getView();
page.show();
You should just do:
Alloy.createController('views/popup').getView().open();
You can find more info about this in a splendid article by Fokke Zandbergen.
/John