Google Maps URL Schema for multi stops [closed] - ios

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I would like to open Google Maps app on iOS using the url scheme for showing directions with multiple stops.
The web url for testing is:
https://google.com/maps/dir//49.54643774,22.28223445/49.54679476,22.28170513/49.54726735,22.28154318/49.54760869,22.28156607/49.54820312,22.2815506/49.54856556,22.28146425/49.54907329,22.28133231/49.54989807,22.28207924/49.55017454,22.2824851/49.55064392,22.28306989/49.5508548,22.28325003/49.55143275,22.28381447/49.55169439,22.28410868/49.5520271,22.28443534
I tried many configurations of the app scheme using comgooglemaps:// without success.

You can read the Google Maps documentation for opening the app.
To simplify it, this is the format you need to follow:
comgooglemaps://?saddr=Google,+1600+Amphitheatre+Parkway,+Mountain+View,+CA+94043&daddr=Google+Inc,+345+Spear+Street,+San+Francisco,+CA&center=37.422185,-122.083898&zoom=10
in swift you would do something like this, take note of the callback option, you can choose to not have it if you don't want to return to your app:
let testURL = URL(string: "comgooglemaps-x-callback://")!
if UIApplication.shared.canOpenURL(testURL) {
let directionsRequest = "comgooglemaps-x-callback://" +
"?daddr=John+F.+Kennedy+International+Airport,+Van+Wyck+Expressway,+Jamaica,+New+York" +
"&x-success=sourceapp://?resume=true&x-source=AirApp"
let directionsURL = URL(string: directionsRequest)!
UIApplication.shared.openURL(directionsURL)
} else {
NSLog("Can't use comgooglemaps-x-callback:// on this device.")
}
Edit: To use coordinates, use it this way:
comgooglemaps://?saddr=52.3668563,4.8890813&daddr=52.357516,4.902319&zoom=10
Edit 2: For for more points on the map append coordinate using +to:Latitude,Longtitude to the daddr parameter
comgooglemaps://?saddr=52.3668563,4.8890813&daddr=52.357516,4.902319+to:52.357786,4.891913&zoom=10

Related

How to check launch image is added in application using XCUITest? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
i have implemented XCTest case for each module and i'm looking for how to know that launch Image is added in xcasset using xctest case.
Not entirely sure what you're going for here.
You could check if LaunchImage is available by checking the bundle images for the name.
func checkIfLaunchImageAvailable() -> Bool {
for imageName in Bundle.main.paths(forResourcesOfType: "png", inDirectory: nil) {
if imageName.contains("LaunchImage"), UIImage(named: imageName) != nil {
print("Launch image is available!")
return true
}
}
return false
}
And could check using XCTAssertTrue:
XCTAssertTrue(checkIfLaunchImageAvailable)

Getting video details in flutter/dart [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have a video inside my device but I want to extract the following details of the video(In flutter/dart)-
1.When the video was taken.
2.Duration of the video
3.Type of the Video
4.When the video was taken
Currently i am using Ff-mpeg plugin but it is taking too long time before it returns metadata information.
You may need to use FFMPEG as follows
import 'package:flutter_ffmpeg/flutter_ffmpeg.dart';
class VideoDetail {
final FlutterFFmpeg _flutterFFmpeg = new FlutterFFmpeg();
VideoDetail() {
_flutterFFmpeg
.getMediaInformation("<file path or uri>")
.then((info) => print(info));
}
}
Do not forget to add dependency
flutter_ffmpeg: ^0.1.1
For more information please visit
https://pub.dartlang.org/packages/flutter_ffmpeg

iOS ship application with pre populated sqlite database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to ship my ios application(written in swift) with my pre populated sqlite database which will be updated through syncing with server. In android I could move the db from assests folder to databases and volla, but in ios I'm quiet lost how can I achieve this?
Thanks
In iOS you can add the database into the Project Supporting files. This will be added in with the binary, which you can then access and copy it across.
To get the location of the pre-populated database from NSBundle:
let databasePath = NSBundle.mainBundle().URLForResource("databaseName", withExtension:"sqlite3");
Get the URL of the Documents Directory using NSFileManager:
//Should have an error pointed in case there is an error.
let documentsDirectory = NSFileManager.defaultManager().URLForDirectory(NSSearchPathDirectory.DocumentDirectory, inDomain:NSSearchPathDomainMask.UserDomainMask, url:nil, shouldCreate:false, error:nil);
Finally copy the file:
if let source = databasePath, destination = documentsDirectory
{
destination = destination.URLByAppendingPathComponent("database.sqlite3")
var result = NSFileManager.defaultManager().copyItemAtURL(source, toURL:destination, error:nil)
//Should have an error pointer, check that the result is true. If not check error.
}
The simple way is:
+ Choose the persistent URL is somewhere in your library folder/sub-folder (or documents if you want).
+ when you implement your persistentStoreCoordinator, first check if the .sqlite exists at the URL above. If not, copy your .sqlite file to that location, if yes, do nothing.
+ init your persistent store with that url.
You have to sure that the .sqlite's datas match the DB model

Swift: Create table of results from SwiftyJson Results [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have been playing around with Swift as I'm new to iOS Development and really enjoying getting to know the language. Recently I have started to look at installing third party plugins etc and I found one called SwiftyJson (https://github.com/SwiftyJSON/SwiftyJSON) I have managed to get it to work using this script:
request(.GET, url, parameters: parameters)
.responseJSON { (req, res, json, error) in
if(error != nil) {
NSLog("Error: \(error)")
println(req)
println(res)
}
else {
NSLog("Success: \(url)")
var json = JSON(json!)
println(json)
}
}
I would like to know two things: 1) Is it possible to get the list of results from the JSON provided into a UITableView like so:
Item 1
----------------------------
Item 2
----------------------------
Etc.. and 2) How would I do that?
Edit: Json
Sorry about image - I couldn't copy it because of a stupid chrome extension I have:
Yes it is possible, though you aren't really using the important features of SwiftyJSON in this code sample. The most straightforward way would be to create the tableview the same as you would for anything, likely using an array as your datasource. Once you've received your JSON you still need to parse it and create the objects for your array. Perhaps if you included a snippet of the JSON, it would be easier to help.

How can I implement Equalizer in my iPhone application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am Developing the iPad app which has Equalizer functionality,which means sound play on three properties( Low, High, Medium). I googled it and found this link: iPhoneMixerEQGraphTest
Its basically mixes the sound but I want to apply equalizer effects on my sound.
Please help.
Have a look at the Audio Unit Component Services Reference documentation. Specifically:
kAudioUnitType_Effect = 'aufx',
and Effect Audio Unit Subtypes:
enum {
kAudioUnitSubType_PeakLimiter = 'lmtr',
kAudioUnitSubType_DynamicsProcessor = 'dcmp',
kAudioUnitSubType_Reverb2 = 'rvb2',
kAudioUnitSubType_LowPassFilter = 'lpas',
kAudioUnitSubType_HighPassFilter = 'hpas',
kAudioUnitSubType_BandPassFilter = 'bpas',
kAudioUnitSubType_HighShelfFilter = 'hshf',
kAudioUnitSubType_LowShelfFilter = 'lshf',
kAudioUnitSubType_ParametricEQ = 'pmeq',
kAudioUnitSubType_Delay = 'dely',
kAudioUnitSubType_Distortion = 'dist',
kAudioUnitSubType_AUiPodEQ = 'ipeq',
kAudioUnitSubType_NBandEQ = 'nbeq'
};

Resources