Custom url scheme redirect does not work with cordova platform ios @5.0.0
See original GitHub issueBug Report
Problem
Using ionic cordova platform ios @5.0.0 Url scheme redirect for OAuth log in, does not work, when app is accessed from within another app. This is working with cordova ios @4.5.4
What is expected to happen?
Installing my app from Test Flight, clicking the ‘open’ button inside Test Flight, opens the app and presents a login view. Clicking ‘log in’ redirects the app using SafariViewBrowser plugin to an OAuth login. Entering credentials, the user are logged in and redirected back to the app, using CustomUrlScheme plugin.
What does actually happen?
After entering credentials the view goes blank and does not return to the app
Information
This might be a plugin issue with SafariViewBrowser or CutstomUrlScheme, however I have tried to reinstall these plugins with different release versions, without luck. the issue is not present if I use cordova ios @4.5.4
Version information
`ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.2.3
Cordova Platforms : android 7.0.0 browser 5.0.4 ios 5.0.0
Ionic Framework : ionic-angular 3.9.4
System:
ios-deploy : 1.9.2
ios-sim : 6.1.3
Node : v8.11.1
npm : 5.6.0
OS : macOS
Xcode : Xcode 10.2 Build version 10E125 `
package.json
{ "name": "printix-app-user", "author": "Printix", "homepage": "http://iprintix.net/", "private": true, "scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", "ionic:build": "ionic-app-scripts build", "ionic:watch": "ionic-app-scripts watch", "ionic:serve": "ionic-app-scripts serve" }, "dependencies": { "@angular/common": "5.2.6", "@angular/compiler": "5.2.6", "@angular/compiler-cli": "5.2.6", "@angular/core": "5.2.6", "@angular/forms": "5.2.6", "@angular/platform-browser": "5.2.6", "@angular/platform-browser-dynamic": "5.2.6", "@ionic-native/core": "4.11.0", "@ionic-native/device": "4.11.0", "@ionic-native/in-app-browser": "4.11.0", "@ionic-native/keyboard": "4.11.0", "@ionic-native/network": "4.11.0", "@ionic-native/qr-scanner": "4.11.0", "@ionic-native/safari-view-controller": "^4.11.0", "@ionic-native/screen-orientation": "4.11.0", "@ionic-native/splash-screen": "4.11.0", "@ionic-native/sqlite": "4.11.0", "@ionic-native/status-bar": "4.11.0", "@ionic-native/vibration": "4.11.0", "@ionic/storage": "^2.2.0", "@ngx-translate/core": "9.1.1", "@ngx-translate/http-loader": "2.0.1", "@types/lodash": "^4.14.109", "angular-2-local-storage": "1.0.1", "angular2-moment": "^1.9.0", "bootstrap-sass": "^3.3.7", "chart.js": "2.7.1", "cordova-android": "7.0.0", "cordova-browser": "5.0.4", "cordova-ios": "4.5.5", "cordova-plugin-add-swift-support": "^2.0.2", "cordova-plugin-customurlscheme": "^4.4.0", "cordova-plugin-inappbrowser": "^3.0.0", "cordova-plugin-network-information": "^2.0.1", "cordova-plugin-qrscanner": "^2.6.2", "cordova-plugin-safariviewcontroller": "^1.5.4", "cordova-plugin-screen-orientation": "^3.0.1", "cordova-plugin-splashscreen": "^5.0.2", "cordova-plugin-statusbar": "^2.4.2", "cordova-plugin-vibration": "^3.1.0", "cordova-plugin-whitelist": "^1.3.3", "cordova-sqlite-storage": "^3.2.0", "es6-promise-plugin": "^4.2.2", "fast-json-patch": "2.0.6", "flag-icon-css": "3.0.0", "immutable": "^3.8.2", "ionic-angular": "3.9.4", "ionic-plugin-deeplinks": "^1.0.17", "ionic-plugin-keyboard": "^2.2.1", "ionicons": "3.0.0", "ios-sim": "^6.1.2", "list": "^2.0.13", "lodash": "^4.17.10", "ngx-order-pipe": "^2.0.1", "rxjs": "5.5.6", "zone.js": "0.8.20" }, "devDependencies": { "@angular/cli": "^7.3.0", "@ionic/app-scripts": "3.2.3", "postcss": "6.0.14", "typescript": "^2.7.2" }, "cordova": { "platforms": [ "browser", "android", "ios" ], "plugins": { "cordova-plugin-network-information": {}, "cordova-plugin-statusbar": {}, "ionic-plugin-keyboard": {}, "cordova-plugin-screen-orientation": {}, "cordova-plugin-vibration": {}, "cordova-plugin-whitelist": {}, "cordova-plugin-add-swift-support": {}, "cordova-plugin-qrscanner": {}, "cordova-plugin-splashscreen": {}, "cordova-sqlite-storage": {}, "cordova-plugin-inappbrowser": {}, "cordova-plugin-customurlscheme": { "URL_SCHEME": "printixapp", "ANDROID_SCHEME": " ", "ANDROID_HOST": " ", "ANDROID_PATHPREFIX": "/" }, "cordova-plugin-safariviewcontroller": {} } } }
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- I included all the necessary information above
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (3 by maintainers)
Top GitHub Comments
cordova-ios, CDVAppDelegate.m post openurl notifiycaiton before observer(CDVHandleOpenURL.m) register notification
fix: in AppDelegate.m
#import “AppDelegate.h” #import “MainViewController.h”
@interface AppDelegate() @property (nonatomic) BOOL pageDidLoad; @property (nonatomic, strong) NSURL * openURL; @end
@implementation AppDelegate
-(void)fixOpenURL { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationPageDidLoad:) name:CDVPageDidLoadNotification object:nil]; }
-(void)applicationPageDidLoad:(NSNotification*)notification { self.pageDidLoad = YES; [self postMessageForOpenURL]; }
-(void)postMessageForOpenURL { if (self.openURL && self.pageDidLoad) { [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:self.openURL]]; } }
@end
@Durzan666 Yes there is.