알림 (안드로이드 알림 영역)의 클릭 이벤트를 얻으려면 계속 노력해야합니다. 실제로 사용자가 알림을 클릭하면 웹 페이지를 열고 싶습니다.알림을 클릭하면 티타늄 - 열린 URL이 표시됩니다.
여기내 코드는,
var intent = Ti.Android.createIntent({
flags : Ti.Android.FLAG_ACTIVITY_CLEAR_TOP | Ti.Android.FLAG_ACTIVITY_NEW_TASK,
data : 'http://www.google.com',
//url : 'http://www.google.com',
className : 'com.android.browser.BrowserActivity',
packageName : 'com.android.browser'
});
intent.addCategory(Ti.Android.CATEGORY_LAUNCHER);
var pending = Ti.Android.createPendingIntent({
activity : Ti.Android.currentActivity,
intent : intent,
type : Ti.Android.PENDING_INTENT_FOR_ACTIVITY,
flags : Ti.Android.FLAG_ACTIVITY_NO_HISTORY
});
var dateValue = new Date();
var notification = Ti.Android.createNotification({
contentIntent : pending,
contentTitle : Title,
contentText : Message,
tickerText : Title,
when : dateValue.getTime(),
icon : Ti.App.Android.R.drawable.appicon,
flags : Titanium.Android.ACTION_DEFAULT | Titanium.Android.FLAG_AUTO_CANCEL | Titanium.Android.FLAG_SHOW_LIGHTS,
sound : Ti.Filesystem.getResRawDirectory() + 'notification.wav',
});
Ti.Android.NotificationManager.notify(1, notification);
내가 말할 수있는 한 [Titanium에서 사용할 수있는 인 텐트] (http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Android.Intent)로 제한되어 있습니다. 안드로이드에 대해 결코 프로그래밍 된 적이 없다면, 앱에 웹뷰를 열거 나 시스템 브라우저를 시작하라는 페이로드로 앱을 여는 인 텐트를 사용해야한다고 생각할 것입니다. – Sukima
[티타늄 - 사용자가 Android 알림을 클릭 할 때 액션 수행] (http://stackoverflow.com/questions/25266834/titanium-perform-action-when-user-clicks-on-android-notification) – Jeroen