2017-01-19 8 views
0

У меня серьезные головные боли с нажатием для iOS с титановым аппликатором.Мое приложение не появляется в уведомляющем центре iOS - Appcelerator

Я сгенерировал несколько версий в testflight, но ни один из них не появился в центре уведомлений iOS, однако, когда я сажусь прямо в устройство, он нормально работает на моем iPad Mini.

настоящее время я использую следующие настройки:

Operating System 
    Name      = Mac OS X 
    Version      = 10.12 

    Architecture    = 64bit 
    # CPUs      = 4 
    Memory      = 4294967296 

Node.js 
    Node.js Version    = 4.6.0 
    npm Version     = 2.15.9 

Titanium CLI 
    CLI Version     = 5.0.9 

Titanium SDK 
    SDK Version     = 5.5.1.GA 
    SDK Path     = /Users/silvio/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA 
    Target Platform    = iphone 

Xcode версии: 8,2 (8C38)

Мой код в Alloy.js:

if (Ti.Platform.name === 'android') { 
    // set android-only options 
    var pnOptions = { 
    senderId: 'xxxx', // It's the same as your project id 
    notificationSettings: { 
     sound: 'mysound.mp3', // Place soudn file in platform/android/res/raw/mysound.mp3 
     smallIcon: 'appicon.png', // Place icon in platform/android/res/drawable/notification_icon.png 
     largeIcon: 'appicon.png', // Same 
     vibrate: true, // Whether the phone should vibrate 
     insistent: true, // Whether the notification should be insistent 
     group: 'Edufy', // Name of group to group similar notifications together 
     localOnly: false, // Whether this notification should be bridged to other devices 
     priority: 2 // Notification priority, from -2 to 2 
    } 
    }; 

} else { // set ios-only options. 
    // Sets interactive notifications as well if iOS8 and above. Interactive notifications is optional. 
    if (parseInt(Ti.Platform.version.split(".")[0], 10) >= 8) { 
    var thumbUpAction = Ti.App.iOS.createUserNotificationAction({ 
     identifier: "THUMBUP_IDENTIFIER", 
     title: "Aceitar", 
     activationMode: Ti.App.iOS.USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND, 
     destructive: false, 
     authenticationRequired: false 
    }); 

    var thumbDownAction = Ti.App.iOS.createUserNotificationAction({ 
     identifier: "THUMBDOWN_IDENTIFIER", 
     title: "Regeitar", 
     activationMode: Ti.App.iOS.USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND, 
     destructive: false, 
     authenticationRequired: false 
    }); 

    var thumbUpDownCategory = Ti.App.iOS.createUserNotificationCategory({ 
     identifier: "THUMBUPDOWN_CATEGORY", 
     // The following actions will be displayed for an alert dialog 
     actionsForDefaultContext: [thumbUpAction, thumbDownAction], 
     // The following actions will be displayed for all other notifications 
     actionsForMinimalContext: [thumbUpAction, thumbDownAction] 
    }); 

    var pnOptions = { 
     types: [Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT, Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND], 
     categories: [thumbUpDownCategory] 
    }; 
    } else { //No support for interactive notifications, omit categories 
    var pnOptions = { 
     types: [Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT, Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND] 
    }; 
    } 
} 

// set cross-platform event 
var onReceive = function(event) {}; 

// Create instance with base url 
var tiPush = require('ti-push-notification').init({ 
    backendUrl: "http://xxxx.com.br/painel/ws/push_test.php" 
}); 

// register this device 
tiPush.registerDevice({ 
    pnOptions: pnOptions, 
    onReceive: onReceive, 
    extraOptions: { 
    action: 'register', 
    user_id: 123 
    } 
}); 

Мои сертификаты в яблоке все хранятся, как показано на рисунках ниже:

Push-уведомления Включено:

enter image description here

Сертификаты:

enter image description here

Прит анкеты:

enter image description here

Кроме того, я попытался добавить Entitlements.plist в этих местах:

  • Project/Entitlements.plist
  • Project/приложение/Entitlements.plist
  • Project/приложение/платформа/ИОС/Entitlements.plist
  • Project/приложение/платформа/ИОС/.plist

Я также добавил строки из внутри тега tiapp.xml, но он не работает ... под кодом Entitlements.plist:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
    <key>aps-environment</key> 
    <string>development</string> <!-- Either development or production --> 
    <key>application-identifier</key> 
    <string>xxxx.com.colegiokennedy</string> 
    <key>keychain-access-groups</key> 
    <array> 
     <string>xxx.com.colegiokennedy</string> 
    </array> 
</dict> 
</plist> 

Я также пытался изменить среду разработки на производство, но это тоже не сработало.

+0

Вы когда-нибудь разрешали это? – Markive

ответ

0

Вы можете попробовать: Ti.App.iOS.USER_NOTIFICATION_TYPE_BADGE.

Убедитесь, что на устройстве iOS перейдите к Настройки -> Уведомления -> Your_App -> Показать в Уведомляющем центре. Вы можете проверить, какие настройки включены/отключены для уведомлений вашего приложения.