Printing with android and Ipad

The activity plugin takes a text message, an image and a  URL.  Not every activity can use all of them. I doubt the activity plugin would print a link (if it did, it’s just going to be text.

Here is the tutorial for this:  https://coronalabs.com/blog/2015/03/17/tutorial-utilizing-the-activity-popup-plugin-ios/

if (UI\_USER\_INTERFACE\_IDIOM() == UIUserInterfaceIdiomPad) { [pic presentFromBarButtonItem:self.printButton animated:YES completionHandler:completionHandler]; } else { [pic presentAnimated:YES completionHandler:completionHandler]; } }

On the iPad, the box that lets you select the printer has to have a point where it radiates out from.  When you use “presentFromBarButtonItem”, it’s expected that you are using a native Button Bar to drive this.  There is an option to use:  presentFromRect instead.  In this case you just need to create a CGrect object (doens’t have to display anything).   Maybe something like:

CGRect \*spot = new CGRectMake(0, 0, 10, 10);

then

if (UI\_USER\_INTERFACE\_IDIOM() == UIUserInterfaceIdiomPad) { [pic presentFromRect:spot animated:YES completionHandler:completionHandler]; } else { [pic presentAnimated:YES completionHandler:completionHandler]; } }

or something like that (untested)

Rob

Hi Rob, Thanks for the reply, I got that, but in option with presenrFromRect there is one more parameter I.e inView. What shall be mention there? I am sorry actually I new with native coding. Regards Varun

Have you tried it with out specifying “inView”.  It may be optional.

Rob

Hi Rob,

Yes I tried without inView but its compulsory .

You of course are treading into areas I don’t have a lot of experience in, but I would go here:

https://github.com/coronalabs/plugins-source-native-popup-activity/blob/master/ios/Plugin/IOSActivityNativePopupProvider.mm

This is the source code for our Activity popup which uses the same iPad methods.  There is an example of getting the view in there.

Rob

Will this also work for a bluetooth connected printer? Or will it not matter if its bluetooth or wifi?

Warren

If the OS can print to the printer, then it should.

Rob

Will this also work for a bluetooth connected printer? Or will it not matter if its bluetooth or wifi?

Warren

If the OS can print to the printer, then it should.

Rob