Building Passbook Passes - ios

I've been working on integration of Passbook for some of my apps. Right now, I've used Ray Wenderlich's tutorial on this, and it is quite frankly a pain to build even one Pass. I have to get the icon files all in place, program the JSON file, get the manifest file filled in with all the SHA1 values, and run a few lines in terminal to sign it, and then another line to zip it. Are there any online services or programs that can be used to save a pkpass file to computer, that I can then upload to my server?

There are also quite some developer tools that help you to create passes, you can find a list on wikipedia.
We provide an Objective-C SDK and a free cloud service that lets you create templates and generate passes. You can find the SDK on github (Sample App is included).

There are a number of services that can be used to generate passess. Take a look on wikipedia for a comprehensive list of providers, tools and projects.
If you want to update passes, then you will need to build a Passbook Web Service. When a pass is updated, the web service sends a new .pkpass bundle to the device. Therefore, your web service must also be capable of signing passes unless you want to manually create and upload them to your server before sending out a push request.
Using our service, PassKit, you can create a template using WSIYWIG editor then create a pass directly on your server via a simple API call. You can also update passes and push updates to passes via our API. If you just want to get hold of the .pkpass bundle, then you can append /d to the pass URL (the one beginning with r.pass.is), or use PassKit API in your User Agent string.

you should also check out Apple's Passbook Support Materials here:
https://developer.apple.com/passbook/
They have a simple XCode project called SignPass that you can use to easily create your own Passes.
Note: you need to be a member of Apple's Developer program to access these materials ..
There's lots more Passbook related info here:
http://www.flonsolutions.com
Andrew

Related

How to create custom AR button

Does someone have any examples how to generate AR URL?
Reading Web SDK documentation, seems that there is no functionality to do that.
Found https://github.com/Roomle/roomle-button but not sure that`s still way to go since it has not been updated for 2 years.
If you are using the Roomle SDK you can use saveCurrentConfiguration to get the configuration id (hash) of the current configuration. Not sure what you used at the moment to obtain a configuration id but you need to call this in order to save it on the Roomle server and open it in another place.
Also make sure to set the configuratorId URL param when linking to the AR site.

how to implement implement deferred deep linking in electron

Trying to find information on how to implement deferred deep linking in electron app but can't find it in the official electron documentation.
We have an electronic application. I need the following behavior: when a user tries to open a link of this type -> custom-protocol: // some-data in the browser, if the application is not installed, then automatically download the application and, after installation, pass the parameters contained in the link (some-data) to the application. Can anyone suggest how to implement this in electronic or a link to the documentation or show some abstract example of implementation
On Windows, custom protocols are stored in the registry. This is a chicken and egg problem because your application already has to be installed on the system for the registry entry to exist.
If you rewrite your application as a UWP app (lol) you might be able to check with getInstalledRelatedApps to see if the app is already installed.
If you want to streamline how your application is installed from the web, consider using ClickOnce.
So basically you just want a way to pass some query params to your application when installed from your website.
You can do this if you package your electron application as an MSIX. Check out the article below from Microsoft, that documents the process:
Passing query params to an MSIX packaged app

How to: securely store secret tokens when publishing iOS App (Nativescript)

My Nativescript app has some secret api tokens. I want to publish the app to the iOS app store. What do I need to do to keep the tokens secret when I publish the app?
I see a discussion here about storing secrets using webpack environmental variables. I am new to webpack, but it seems like this is the best way to do it.
Following that discussion, I am able put my tokens into the webpack bundle (instead of hardcoding it), like this:
$ tns run ios --bundle --env.uglify --env.aot --env.secret_token="yaySecret"
But does this keep "yaySecret" secret? I don't see this addressed anywhere in NS docs or online.
I assume this bundle command creates a bundle, and then this bundle becomes part of what Apple publishes. But then isn't Apple able to view "yaySecret"?
Uglify actually does the job here (--env.uglify).
--env.secret_token will be just a parameter that is passed to the compiler. It will replace the occurrence of the variable in source code with actual value based on your webpack define configuration.
You should have something similar to this in your webpack config
// Define useful constants like TNS_WEBPACK
new webpack.DefinePlugin({
"global.TNS_WEBPACK": "true",
"global.SECRET_TOKEN": JSON.stringify(env.secret_token),
"process": undefined,
}),
So all occurrence of global.SECRET_TOKEN in your actual source code will be replaced by actual token you passed in command line.
So far it had nothing to do with security, reverse engineering the APK may show the entire source code and token value. Using minimizers like Uglify is what makes your code hard to read.
There are many other minimizers / obfuscators in market, javascript-obfuscator is one free tool I have seen people using with NativeScript often. All of these tools have tons of options, if you want to encrypt your code properly, you might need to pay more attention to those options.
There are even paid tools like jscrambler. Using Obfuscators are not limited to NativeScript / JavaScript, even many native android apps use Java Obfuscator to prevent extraction of source code & sensitive information from the APK. So using an Obfuscator is very much common irrespective of platform you choose.
Additionally what you could do is, do not simply hard code your token. You may pass some encrypted value to env.secret_token, then write some complex function which can take this encrypted value and give you the actual token at run time. End of the day it's all about making your code harder to break.

Modifying Hyperledger Composer WebApp

I've completed the Hyperledger Composer Developer tutorial https://hyperledger.github.io/composer/tutorials/developer-guide.html and I've generated the BNA, deployed it to a local Hyperledger Fabric 1.0 instance, generated the REST API, and generated the skeleton webapp using yo.
However, I noticed that the resulting webapp only has a menu for adding assets, and none for adding participants and submitting transactions. I have two questions:
1) Why doesn't the webapp generate menus for adding participants and submitting transactions? (or does it, and how do I get it to do that?)
2) In an attempt to add the ability to add participants and submit transactions through the webapp, I've looked through the app directory for the relevant source code but became confused as I'm relatively new to web/angular dev.
Is there any reference documentation to show which source files need to be edited to add participants and transactions?
As far as I can tell, \src\app folder has the source files but I don't understand the roles that each of these files play:
app.component.html has the actual HTML menus, but what is this [routerLink] referring to?
I noticed for each asset that there is a subfolder with a CSS, HTML, and three .TS files. Are these needed for each participant as well?
Any direction or reference on how to modify the web app to accommodate adding participants and transactions would be much appreciated.
1) Why doesn't the webapp generate menus for adding participants and submitting transactions? (or does it, and how do I get it to do that?)
Because its a very simple skeleton NG2 app scoped to assets, which you as a developer can add to. You can easily add REST API calls (operations) from your Angular app to (for example) submit transactions. This is how you should interact with the runtime Fabric using Composer REST operations.
2) Is there any reference documentation to show which source files need to be edited to add participants and transactions?
This is a straightforward Angular tutorial https://angular.io/tutorial and here https://angular.io/guide/quickstart - and this tutorial will help explain Angular further.
The dataservice in the generated App is where the current 'asset' REST operation is called from and further REST operations can be added here -> /src/app/data.service.ts

VSCode extension IPC with UI inside HTML preview

I wish to develop a unit test runner extension for VSCode. The extension should display discovered tests grouped into expandable hierarchy, annotate run status, display output and errors for each test, provide run/debug commands on different levels, and of course the red/green bar.
Roughly spearating this into "model" and "view", I plan to implement the model in the extension process, and I plan to implement the view as HTML preview based on a TextDocumentContentProvider. (Is there a better approach?)
Now, the model and the view should communicate with each other. I want to implement the view as a single-page application. The view will send commands to the model, and the model will send events to the view (or the view will poll the model for events). The view will update itself according to received events.
My question is, what communication technique should I use? Can HTML page inside the HTML preview access VSCode/Atom/Electron/Node APIs? Can I share object instances, or do some lightweight IPC? By far I didn't figure out.
I've found that I can invoke VSCode commands or refresh the entire page, when the user clicks a link with href set to specific scheme (command:// or the one I registered for my TextDocumentContentProvider).
I do succeed to open an HTTP listener (http.createServer) in the extension process, and communicate through XMLHttpRequest on the HTML preview side. But it looks to me like a heavy overkill.
I wonder if there are more appropriate ways to do this?
Almenon is referring to the currently proposed Webview API that was released in version 1.21 (Feb 2018). For the time being, this appears to be a much better approach for HTML previews. But in order to use the API, there are special instructions. From the release notes:
These APIs are still proposed, so in order to use it, you must opt into it by adding a "enableProposedApi": true to package.json and you'll have to copy the vscode.proposed.d.ts into your extension project.
What isn't clarified (and probably should be) is how to add the downloaded declaration file to a project. One way to do it is place the file in $/node_modules/vscode, next to vscode.d.ts, which is generated during postinstall. Then add the following line to the top of vscode.d.ts:
/// <reference path="vscode.proposed.d.ts" />
That will link the type declaration files. To make this part of the installation process, write a build task to do it and then call it in the vscode:postinstall script in package.json.
VSCode has a new API that makes this easier.
https://github.com/Microsoft/vscode/issues/43713
You can find the new API here
To try the new API:
Add "enableProposedApi": true to your package.json
Manually download vscode.proposed.d.ts and add it to your project: https://raw.githubusercontent.com/Microsoft/vscode/master/src/vs/vscode.proposed.d.ts
Run your extension with the latest VS Code insiders build

Resources