martedì 7 luglio 2015

Missing Push Notification Entitlement e PhoneGap

Sto sviluppando una applicazione Android/IOS e per non perdere la testa su due versioni ho deciso di usare Phonegap per mantenerel lo sviluppo centralizzato anche se di fatto non uso le API di Phonegap

Al momento di effettuare il primo upload su Apple Store (dopo che tutte le verifiche di XCode erano state superate) ho ricevuto nel giro di un secondo la seguente mail

----------------------------------------
Dear developer,
We have discovered one or more issues with your recent delivery for "Abetone Trail Park". Your delivery was successful, but you may wish to correct the following issues in your next delivery:
Missing Push Notification Entitlement - Your app appears to include API used to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. See "Provisioning and Development" in the Local and Push Notification Programming Guide for more information. If your app does not use the Apple Push Notification service, no action is required. You may remove the API from future submissions to stop this warning. If you use a third-party framework, you may need to contact the developer for information on removing the API.
After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.
Regards,
The App Store team
----------------------------------------

Di fatto non uso le notifiche sulla mia applicazione e quindi non riuscivo a capire il motivo dell'errore.
Guardando il codice sorgente di PhoneGap, piu' precisamente in AppDelegate.m, sono presenti due funzioni

----------------------------------------
- (void)      application:(UIApplication*)application
    didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
    // re-post ( broadcast )
    NSString* token = [[[[deviceToken description]
        stringByReplacingOccurrencesOfString:@"<" withString:@""]
        stringByReplacingOccurrencesOfString:@">" withString:@""]
        stringByReplacingOccurrencesOfString:@" " withString:@""];

    [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
}

- (void)                                 application:(UIApplication*)application
    didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
    // re-post ( broadcast )
    [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];

}
----------------------------------------

E' stato sufficiente commentare le due funzioni, ricompilare e rimandare a Apple Store per vedere scomparire il messaggio di errore

Nessun commento:

Posta un commento

Update Plotly Dash Csv

    from dash import Dash , html , dcc , callback , Output , Input , State import plotly . express as px import pandas as pd import...