ユーザーが最初にアプリにログインしたときにのみ指示ウィンドウを表示することが目的の場合は、ユーザーの訪問回数を保存する必要はありません。
someController.js
function onLoginSuccess() {
// getInt() will return the value of INSTRUCTION_WINDOW property, you can name this property whatever you want.
// if this property does not exist, then it will return the value of the second parameter.
var showInstruction = Ti.App.Properties.getInt("INSTRUCTION_WINDOW", 1);
if (showInstruction) {
Alloy.createController('instructionWindow').getView().open();
} else {
Alloy.createController('nextWindow').getView().open();
}
}
// logout function can be anywhere
// remember to set the property to 1 if you want to show the instructions again after logout and then login.
function logout() {
Ti.App.Properties.setInt("INSTRUCTION_WINDOW", 1);
}
instructionWindow.js
$.instructionWindow.addEventListener('open', function() {
// after opening the instruction window, set this property to 0
// so it won't be shown up the next time the already logged-in user opens the app
Ti.App.Properties.setInt("INSTRUCTION_WINDOW", 0);
});
HIのPrashant SAINI、reply.Howを与えるためのおかげで、我々は、複数のユーザーがapp.itにログインします扱うことができるが指示画面が表示されないだろうすでにそのページにアクセスしています。 – Balu
アプリで最初にアクセスしたすべてのユーザーにヘルプ画面を表示したい場合は、ログインカウントをデータベースに保存してlogin web-serviceで取得し、そのユーザーがアプリを初めて使用する しかし、アプリのほとんどは、ユーザーが誰であろうと、アプリがデバイスで最初に開かれたときにのみ、ヘルプ画面を表示することを心配しています。 –