Discussion:
AirPrint in iOS 11?
(too old to reply)
Alex Zavatone
2018-05-12 00:55:55 UTC
Permalink
I did it a few months ago. Have you tried the sample code?

https://developer.apple.com/library/content/samplecode/PrintBanner/Introduction/Intro.html#//apple_ref/doc/uid/DTS40013422
As an addendum: I've verified that I can print from the iPhone Photos app to my printer using AirPrint. The issue is doing it programmatically.
Is printing from iOS still possible? Is AirPrint still a viable SDK to use?
I can get AirPrint to bring up a printer selection screen, but it won't actually select a printer.
UIPrinterPickerController *printPicker =
[UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
{
// . . .
}];
"Printer Select Printer >"
and below, it shows a preview of the image that will be printed. So far, so good.
If I tap on "Select Printer >" it takes me to a tableview list of the available printers.
If I tap an available printer, it takes me back to the default screen, with NO printer selected!
The printer is an AirPrint-capable device (Canon), on the local wifi with the iPhone. I've implemented all of the UIPrintInteractionControllerDelegate callbacks (none of which get called).
What is going wrong here? There's nothing in the Xcode log.
-Carl
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/newslists%40autonomy.caltech.edu
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.net
Carl Hoefs
2018-05-12 01:02:56 UTC
Permalink
Yep. There's not much to go wrong. That's why I can't understand why it doesn't select the printer from my app (but Photos can). That part is really out of my control. You present the picker and it's supposed to perform the selection. If it doesn't, I'm clueless.

-Carl
Post by Alex Zavatone
I did it a few months ago. Have you tried the sample code?
https://developer.apple.com/library/content/samplecode/PrintBanner/Introduction/Intro.html#//apple_ref/doc/uid/DTS40013422
As an addendum: I've verified that I can print from the iPhone Photos app to my printer using AirPrint. The issue is doing it programmatically.
Is printing from iOS still possible? Is AirPrint still a viable SDK to use?
I can get AirPrint to bring up a printer selection screen, but it won't actually select a printer.
UIPrinterPickerController *printPicker =
[UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
{
// . . .
}];
"Printer Select Printer >"
and below, it shows a preview of the image that will be printed. So far, so good.
If I tap on "Select Printer >" it takes me to a tableview list of the available printers.
If I tap an available printer, it takes me back to the default screen, with NO printer selected!
The printer is an AirPrint-capable device (Canon), on the local wifi with the iPhone. I've implemented all of the UIPrintInteractionControllerDelegate callbacks (none of which get called).
What is going wrong here? There's nothing in the Xcode log.
-Carl
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/newslists%40autonomy.caltech.edu
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.net
Carl Hoefs
2018-05-12 01:59:47 UTC
Permalink
Okay, got it to work. The sample code I had based mine on was too old (WWDC '14) .

Thanks for the link, Alex!
-Carl
Post by Alex Zavatone
I did it a few months ago. Have you tried the sample code?
https://developer.apple.com/library/content/samplecode/PrintBanner/Introduction/Intro.html#//apple_ref/doc/uid/DTS40013422
As an addendum: I've verified that I can print from the iPhone Photos app to my printer using AirPrint. The issue is doing it programmatically.
Is printing from iOS still possible? Is AirPrint still a viable SDK to use?
I can get AirPrint to bring up a printer selection screen, but it won't actually select a printer.
UIPrinterPickerController *printPicker =
[UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
{
// . . .
}];
"Printer Select Printer >"
and below, it shows a preview of the image that will be printed. So far, so good.
If I tap on "Select Printer >" it takes me to a tableview list of the available printers.
If I tap an available printer, it takes me back to the default screen, with NO printer selected!
The printer is an AirPrint-capable device (Canon), on the local wifi with the iPhone. I've implemented all of the UIPrintInteractionControllerDelegate callbacks (none of which get called).
What is going wrong here? There's nothing in the Xcode log.
-Carl
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/newslists%40autonomy.caltech.edu
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.net

Continue reading on narkive:
Loading...