Appcelerator : iOS 10 Apple Push Service not working - push-notification

I'm working with SDK 5.5.1
I'm trying to send APS in production with my own nodejs server.
Everything is working fine with publishing on device in development state.
I get the device token and the notification is received by the device.
In production, with the same certificate exports (with the production cert and p12), i can get the device token, but not receive the notification.
Does anyone have a solution ?
Here is my tiapp.xml
<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
<id>app.test.test</id>
<name>test</name>
<version>1.1.2004</version>
<publisher>Zuhn</publisher>
<url>undefined</url>
<description>undefined</description>
<copyright>2016 by Zuhn</copyright>
<icon>appicon.png</icon>
<fullscreen>false</fullscreen>
<navbar-hidden>false</navbar-hidden>
<analytics>true</analytics>
<guid>mynumber</guid>
<property name="ti.ui.defaultunit" type="string">dp</property>
<property name="run-on-main-thread" type="bool">true</property>
<ios>
<team-id>mynumber</team-id>
<enable-launch-screen-storyboard>false</enable-launch-screen-storyboard>
<use-app-thinning>true</use-app-thinning>
<plist>
<dict>
<key>NSContactsUsageDescription</key>
<string>Can we use to your contacts?</string>
<key>NSCameraUsageDescription</key>
<string>Can we use your camera?</string>
<key>NSCalendarsUsageDescription</key>
<string>Can we use your calendar?</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Can we save to your library?</string>
<key>NSMicrophoneUsageDescription</key>
<string>Can we use your microphone?</string>
<key>aps-environment</key>
<string>production</string>
<!-- Either development or production -->
<key>UISupportedInterfaceOrientations~iphone</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIRequiresPersistentWiFi</key>
<false/>
<key>UIPrerenderedIcon</key>
<false/>
<key>UIStatusBarHidden</key>
<true/>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleDefault</string>
<key>UIBackgroundModes</key>
<array>
<string>voip</string>
</array>
</dict>
</plist>
</ios>
<android xmlns:android="http://schemas.android.com/apk/res/android"/>
<mobileweb>
<precache/>
<splash>
<enabled>true</enabled>
<inline-css-images>true</inline-css-images>
</splash>
<theme>default</theme>
</mobileweb>
<modules/>
<deployment-targets>
<target device="android">true</target>
<target device="ipad">false</target>
<target device="iphone">true</target>
<target device="mobileweb">false</target>
<target device="windows">false</target>
</deployment-targets>
<sdk-version>5.5.1.GA</sdk-version>
<plugins>
<plugin version="1.0">ti.alloy</plugin>
</plugins>
<property name="appc-app-id" type="string">mynumber</property>

It's a breaking change from Apple in Xcode 8. You need to create the entitlements file and place it in /app/platform/ios/.entitlements
Example:
MyApp.entitlements
<?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 -->
</dict>
</plist>

Related

Is it in the Gluon API to keep our app in Portrait Mode even if the user rotates their device in Landscape Mode?

After styling my app in portrait mode, I've discovered its layout is not acceptable should the user manipulate their phone to invoke the app into landscape mode. I can put in the time later to rewrite/retest the UX for both portrait and landscape mode, but for the time being is the a way for us to have our app hold portrait mode all the time?
There is no API or Attach service for this yet.
However you can modify the AndroidManifest.xml file (Android) or the Default-Info.plist file (iOS) to force one single orientation, instead of the existing portrait and landscape ones.
Android
See https://docs.gluonhq.com/#_android_2 for reference.
The AndroidManifest.xml file is generated for the project with the gluonfx:package goal, and it is available at target/gluonfx/aarch64-android/gensrc/android.
Copy this file to src/android and make any modification needed:
Portrait
<?xml version='1.0'?>
<manifest xmlns:android='http://schemas.android.com/apk/res/android' package='$your_package' android:versionCode='1' android:versionName='1.0'>
<application android:label='$your_label' android:icon="#mipmap/ic_launcher">
<activity android:name='com.gluonhq.helloandroid.MainActivity'
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait">
<intent-filter>
<category android:name='android.intent.category.LAUNCHER'/>
<action android:name='android.intent.action.MAIN'/>
</intent-filter>
</activity>
</manifest>
Landscape
<?xml version='1.0'?>
<manifest xmlns:android='http://schemas.android.com/apk/res/android' package='$your_package' android:versionCode='1' android:versionName='1.0'>
<application android:label='$your_label' android:icon="#mipmap/ic_launcher">
<activity android:name='com.gluonhq.helloandroid.MainActivity'
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="landscape">
<intent-filter>
<category android:name='android.intent.category.LAUNCHER'/>
<action android:name='android.intent.action.MAIN'/>
</intent-filter>
</activity>
</manifest>
Then run again gluonfx:package, the final manifest will contain the changes.
iOS
See for reference https://docs.gluonhq.com/#_ios_2.
The configuration is defined by the keys UISupportedInterfaceOrientations and UISupportedInterfaceOrientations-ipad. By default with values:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
Add the file src/main/resources/META-INF/substrate/ios/Partial-Info.plist and include this code:
Portrait
<?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>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>
Landscape
<?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>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Then run mvn gluonfx:link again, the final plist will contain these changes.

How should I go about adding a Custom URL Scheme to my Info.plist file for firebase phone auth?

This question is in relation to Why firebase phone auth requires a custom URL scheme to be registered in Xcode?
I have tried a couple of things to add Custom URL Scheme to my Info.plist to no luck
I added the following lines to my Info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.googleusercontent.apps</string>
<key>CFBundleURLSchemes</key>
<array>
<string>apps.{{CLIENT_ID}}</string>
</array>
</dict>
</array>
EDIT:
Solved the problem by modifying the above lines like this
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.{{CLIENT_ID}}</string>
</array>
</dict>
</array>
Add it in Info > Url Types like so:
More details here:
https://firebase.google.com/docs/auth/ios/phone-auth#set-up-recaptcha-verification

ERROR ITMS-90045: "Invalid Code Signing Entitlements - 'UISupportedInterfaceOrientations'

Im trying to submit my app to the apple store but I am getting a 16 errors after I archive for publishing : This is the first one:
ERROR ITMS-90045: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, key 'UISupportedInterfaceOrientations' in 'Payload/Caregiver.iOS.app/Caregiver.iOS' is not supported."
I dont know where to start to solve this?
The contents of the Info.plist file is as follows:
<?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>CFBundleDisplayName</key>
<string>Caregiver</string>
<key>CFBundleName</key>
<string>Caregiver</string>
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<key>CFBundleVersion</key>
<string>1.2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CFBundleIdentifier</key>
<string>com.wisepill.Caregiver</string>
</dict>
</plist>
In the Info.plist file in iOS project add this line
<key>UISupportedInterfaceOrientations</key>
<array/>
I recreated the provisioning profile and it went through! Clearly, the app store submissions process does not always provide error messages that point to the actual root cause of the issue.

Xamarin.Forms IOS move xcassets folder

Until a few days ago in my iOS project the Media.xcassets folder was under the
Resources folder.
Now is under the root of the application and if I try to move no one of the images are showed.
It's possible to move this folder under the Resoures folder like before?
Thank you.
EDIT:
This is my Info.plist file:
<?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>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>MinimumOSVersion</key>
<string>10.0</string>
<key>CFBundleDisplayName</key>
<string>SgatMobileV2</string>
<key>CFBundleIdentifier</key>
<string>it.volos.SgatMobile</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon-60#2x</string>
<string>Icon-60#3x</string>
<string>Icon-76</string>
<string>Icon-76#2x</string>
<string>Default</string>
<string>Default#2x</string>
<string>Default-568h#2x</string>
<string>Default-Portrait</string>
<string>Default-Portrait#2x</string>
<string>Icon-Small-40</string>
<string>Icon-Small-40#2x</string>
<string>Icon-Small-40#3x</string>
<string>Icon-Small</string>
<string>Icon-Small#2x</string>
<string>Icon-Small#3x</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>XSAppIconAssets</key>
<string>Resources/Media.xcassets/AppIcons.appiconset</string>
<key>XSLaunchImageAssets</key>
<string>Resources/Media.xcassets/LaunchImages.launchimage</string>
<key>CFBundleDocumentTypes</key>
<array>
</array>
<key>NSCameraUsageDescription</key>
<string>This app needs access to the camera to take photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photos.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app needs access to the photo gallery.</string>
</dict>
</plist>

How do i associate excel file type (xlsx) with iPhone application

Hi i have managed to open .xls files form mail app by adding document type to the project build and set the Types field to "com.microsoft.excel.xls" (see screen shot).
I want to do the same with xlsx files but can't do it. I tried to add "com.microsoft.excel.xlsx" but it didn't work
I solved that by defining custom UTI as follows. Try to add these definitions into your info.plist. It works as expected.
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeDescription</key>
<string>XLSX input table document</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>xlsx</string>
<key>public.mime-type</key>
<string>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</string>
</dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeIdentifier</key>
<string>com.mydomain.myapplication.xlsx</string>
</dict>
</array>
....
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>XLSX input table document</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.mydomain.myapplication.xlsx</string>
</array>
</dict>
</array>
The identifier for XLSX files is org.openxmlformats.spreadsheetml.sheet
Checkout: https://escapetech.eu/manuals/qdrop/uti.html
XSLX is already declared as org.openxmlformats.presentationml.presentation

Resources