Titanium:Ti.Map is undefined? - titanium

I guess I must have done an update, since my app stopped working.
The line is simple enough:
var marker = Ti.Map.createAnnotation({
latitude: json.objects[0].tour[e.index].locations[i].latitude,
longitude: json.objects[0].tour[e.index].locations[i].longitude,
title: json.objects[0].tour[e.index].locations[i].name,
subtitle: json.objects[0].tour[e.index].locations[i].excerpt,
animate: true,
pincolor: Ti.Map.ANNOTATION_GREEN,
leftButton: '../images/pointer.png',
image: '../images/pointer.png'
});
But when I try to compile I get:
'undefined' is not an object (evaluating 'Ti.Map.createAnnotation')
I added the Ti.Map as a watch expression and it says it's undefined?
What did I do wrong?

Ti.Map was removed in 3.2.0. Check out the deprecation note from Appcelerator (linked below) to learn more.
http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Map
Basically, what you want now is:
var Map = require('ti.map'),
annotation = Map.createAnnotation({ ... }),
mapView = Map.createView({ ... });
The docs for the module are here:
http://docs.appcelerator.com/titanium/3.0/#!/api/Modules.Map

Related

Cannot read property 'requestContent' of undefined. Epubjs

I used Epubjs. But when I run the application. It turns out "Cannot read property 'requestContent' of undefined". Maybe it is about Asynchronous loading.`
// # is an alias to /src
import Epub from 'epubjs'
global.ePub = Epub
export default {
name: 'home',
mounted () {
this.book = new Epub('/public/东京暗鸦_qinkan.net.epub')
this.book.renderTo('read', {
width: window.innerWidth,
height: window.innerHeight
})
}
}
</script>`
I saw this issue in Chrome and loaded the new code into FF instead and it was showing me a Cross Origins blocked error (which makes sense because I hadn't added that to my API yet).
So this appears to be a chrome issue but might want to look into Cross-origin being blocked in your API.

React-Native - com.google.android.gms.common.api.ApiException: 400: Cannot shorten a short Dynamic Link

I was working on my react native dynamic links feature.
I have tried the following code for creating links :
const generatedDynamicLink = await firebase.dynamicLinks().buildLink({
link: `https://test.page.link/groupinvite/name=test`,
domainUriPrefix: `https://test.page.link/groupinvite`,
android: {
packageName: 'com.test',
},
ios: {
bundleId: 'com.test',
appStoreId: '1546898245',
},
});
Above method works perfectly.
But, it gives me a long link like,
https://test.page.link//guestinvite?apn=com.test&ibi=com.test&isi=1498742044&link=https%3A%2F%2Ftest.page.link/%2Fguestinvite%2Fname%3Dtest
So to shorten the link i'm replacing firebase.dynamicLinks().buildLink(....) with "firebase.dynamicLinks().shortLink({.....},"SHORT")" But it gives me an error like,
Error: [dynamicLinks/build-failed] com.google.android.gms.common.api.ApiException: 400: Cannot shorten a short Dynamic Link:
So can anybody please suggest me a workaround solution to create a short link like "com.test/guestinvite/abdgsyd" ?
Also, how to easily fetch the initial link.
Currently i am using following link but i'm not able to get query parameter "name" from link.
componentDidMount() {
dynamicLinks().getInitialLink().then((initialLink)=>{
console.log('initialLink : ', initialLink.url);
});
}
I am using following dependencies :
"#react-native-firebase/app": "^6.3.4",
"#react-native-firebase/dynamic-links": "^6.3.4",
Thanks.
Following this tutorial, they made with:
import dynamicLinks from '#react-native-firebase/dynamic-links';
const link = await dynamicLinks().buildLink({
link: 'https://invertase.io',
domainUriPrefix: 'https://xyz.page.link',
analytics: {
campaign: 'banner',
}
});
In your case, it would be:
import dynamicLinks from '#react-native-firebase/dynamic-links';
const generatedDynamicLink = await dynamicLinks().buildLink({
link: `https://test.page.link/groupinvite/name=test`,
domainUriPrefix: `https://test.page.link/groupinvite`,
android: {
packageName: 'com.test',
},
ios: {
bundleId: 'com.test',
appStoreId: '1546898245',
}
});
I dont know if this is going to work, but i hope so.

Where include this params?

I used Framework7 + Vue.js and where include this params:
showBarsOnPageScrollEnd: false
I include in app init. but don't work this
Framework7 documentation shows an example on how to include Navbar parameters (not Vue specific):
// if you use it on navbars:
var app = new Framework7({
navbar: {
hideOnPageScroll: true,
iosCenterTitle: false,
// added by me, not in the documentation
showOnPageScrollEnd: false,
},
});
// if you use it on toolbars:
var app = new Framework7({
toolbar: {
hideOnPageScroll: true,
// added by me, not in the documentation
showOnPageScrollEnd: false,
},
});
The link to the documentation: https://framework7.io/docs/navbar.html
Please note, that the property you use showBarsOnPageScrollEnd is not in the documentation - probably it's deprecated.

Vue Storybook Jest Addon configuration problem

I wonder if someone using the jest addon can share it's Vue Storybook configuration, since I can't seem to make it work. I've tried the global mode:
In Storybook's config.js:
import { withTests } from '#storybook/addon-jest';
import results from '../.jest-test-results.json';
addDecorator(
withTests({
results,
})
);
And inside my Story:
storiesOf('Elements/Tag', module)
.addParameters({ jest: ['ThuleTag'] })
.addDecorator(VueInfoAddon)
.addDecorator(withTests({ results })('ThuleTag'))
.add('Squared',
withNotes(_notes)(() => ({
components: {ThuleTag},
template: _template,
propsDescription: {
size: 'medium / small / mini',
type: 'success / info/warning / danger'
}
})),
)
I get this error:
TypeError: Object(...)(...).addParameters is not a function
I've also tried the local way:
In my Story:
import { storiesOf } from '#storybook/vue'
import { withNotes } from '#storybook/addon-notes'
import results from '../../../jest-test-results.json'
import { withTests } from '#storybook/addon-jest'
import ThuleTag from '../../components/ui/elements/ThuleTag.vue'
let _notes = `A simple wrapper for the Elements el-tag, that accepts the same <i>type</i> and <i>size</i> props`
let _template = `<thule-tag
size="small"
key="name">Tag Namez
</thule-tag>`
storiesOf('Elements/Tag', module)
.addDecorator(withTests({ results }))
.add('Squared',
withNotes(_notes)(() => ({
components: {ThuleTag},
template: _template,
propsDescription: {
size: 'medium / small / mini',
type: 'success / info/warning / danger'
}
})),
{
jest: ['ThuleTag.test.js'],
}
)
Here I get this error:
Error in render: "TypeError: Cannot read property '__esModule' of undefined"
And the Tests tab is shown with this message:
This story has tests configured, but no file was found
Can someone point me what's messing things up please?
It looks like storybook jest addon is not supported for Vue.js for now
https://github.com/storybooks/storybook/blob/master/ADDONS_SUPPORT.md
Ok, about first error
Error in render: "TypeError: Cannot read property '__esModule' of undefined"
I think that you should check your babel-config, It seems like you forget some presets for your framework.
About second question
This story has tests configured, but no file was found
That problem happens from Jest and storybook/addon-jest want to get with equals api, but they can't. In last versions of Jest, output file structure has options.testResults , but storybook/addon-jest wants options.results & options.results.testResults.
There are two possible solutions:
use appropriate version of Jest and storybook/addon-jest
apply huck in index.js of storybook-jest library, smth like that
if (testFiles && !testFiles.disable) {
//todo: HERE should be your storybook hack
options.results = options.tests.testResults;
options.results.testResults = options.results;
emitAddTests({
kind: kind,
story: story,
testFiles: testFiles,
options: options
});
}

What are the available options for LayoutAnimation.Types

I have a custom layout animation taken from here.
var CustomLayoutAnimation = {
duration: 200,
create: {
type: LayoutAnimation.Types.linear,
property: LayoutAnimation.Properties.opacity,
},
update: {
type: LayoutAnimation.Types.curveEaseInEaseOut,
},
};
When running the code i get the following warning
Warning: Failed config type: The config config.update.type is marked
as required in LayoutAnimation.configureNext, but its value is
undefined.
The code has an entry for update.type, yet the warning says it's undefined. I'm guessing that the permitted values have been updated since the gist was written.
I tried to find out the list of available permitted entries but they are not listed in the React Native LayoutAnimation documentation.
I'd like to know :
Is the syntax no longer correct?
Is there a webpage somewhere that details the list of availble Types?
Whenever I run into an issue like this, I go to the source code. Here's the file for LayoutAnimation.js from the react-native source code. Based on this, I see a TypesEnum const declaration at line 25 looking like this:
const TypesEnum = {
spring: true,
linear: true,
easeInEaseOut: true,
easeIn: true,
easeOut: true,
keyboard: true,
};
I suspect that's why you are erring out - curveEaseInEaseOut is not a supported type. Choose one from the list above and I think you should be good to go. Hope this helps!