passbook remind me at the specific time - ios

I use passbook with the following pass.json:
"formatVersion" : 1,
"passTypeIdentifier" : "pass.socialPoint.passbook",
"serialNumber" : "69874562241",
"teamIdentifier" : "9TS732CS23",
"lastUpdated" : "1357177440",
"associatedStoreIdentifiers":[564576004],
"relevantDate" : "2013-01-10T20:50+08:00",
"isRelative" : true,
"locations" : [{
"longitude" : 128.598845,
"latitude" : 35.203006
}],
and I want it to remind me at 20:50, but it doesn't. The time in the pass.json file is 2013-01-10T18:50+08:00.

According to the Apple Documentation (Table 3-2) the relevantDate key is not supported for coupon and storeCard passes. Changing to one of the other Pass Types should allow your notification to display on the lock screen at the specified time.
Your notification time is set to 2013-01-10T18:50+08:00 which is 18:50 in China and 19:50 in Korea (which is where your location is). Try setting as 2013-01-10T20:50+09:00

Related

Storing toggle button states in Firebase

I want there to be ~100 toggle buttons with a hardcoded item associated with them (All users will have the same items) - The toggle represents whether the user has the item or not, in my SwiftUI app. I'm using Firebase for the backend and have implemented authentication and a database (realtime but I think I'm going to change to firestore).
How would I optimally store whether these buttons are checked / unchecked for each user that uses the app?
A solution could be to have all 100 items stored under the users id in a database but this leads to ALOT of repeated data. (1000 users would mean that 100,000 item states are being stored for only 100 distinct items). (Not great for scalability)
E.g :
{
"users": {
"1": {
"name": "Donald Biden",
"items" : {
"House" : "False",
"Car" : "True",
.
.
},
},
"2": {
"name": "Joe Trump",
"items" : {
"House" : "True",
"Car" : "True",
},
"3": { ... }
}
}
Your solution is also the first approach I would think of.
To improve it: Since a toggle button has only two states, you could only store all true values OR all false ones, whatever you think would lead to less entries.
Example if you store only true: in your app you could check if there's a true value for a specific button for the user, otherwise just set it to false.
Edit: to make it more clear, you would not store "House" : "False" in my example. Because there's no House value then you would just set the button to false.
It really depends how you structured your database. However, if you structure it this way, that might help you to use less data storage:
A table matching returning all keys with their unique ids:
KeysTable:
1: "House",
2: "Car",
...
Then, each user's item list could look like this:
"Items": [1, 4, 5, 6, 8, ...] // List only the key ids with "true" values
Lastly, each user can use the keys table to retrieve which keys are on and which ones are off:
Pseudocode:
OnItems = user.items.map { KeysTable.getValueWithKey[$0] }
OffItems = KeysTable.keys.difference(user.items).map { KeysTable.getValueWithKey[$0] }

Boarding pass (pk.pass file) - How to fix false time on iphone reminder after switch of the time zone

The reminder shows a wrong time on my boarding pass after I changed the time zone. E.g. if you want to enter a return flight from a foreign time zone.
The Reminder seems to convert the time zone again although the time was already specified in the local time in the JSON pkpass file.
Depending on the time zone, the reminder may display a delayed time.
What I have already tried (tested on the IPhone 6 and 7):
ignoresTimeZone property to set to true - unfortunately didn't work. But it could also be that I set it in a wrong place (I set it to the highest level).
i set the location of the airport but also this did not work. But it could also be that my test (my smartphone was local by me).
researched everything possible on the internet and unfortunately very often found the same problem but unfortunately no solution.
{
"passTypeIdentifier":"xxxx.xxxx.xx",
"formatVersion":1,
"serialNumber":"xxxx.xxxxx.xxxx.xxxx",
"description":"my boarding pass",
"organizationName":"my organization",
"teamIdentifier":"XXXXXXXXX",
"relevantDate":"2019-07-12T15:00:00+02:00",
"locations" : [
{
"longitude" : -12.3456,
"latitude" : 78.9101112
}
],
"relevantText":"this is a test",
"foregroundColor":"rgb(0,0,0)",
"backgroundColor":"rgb(194,200,155)",
"labelColor":"rgb(200,95,25)",
"boardingPass":{
"headerFields":[
...
],
"primaryFields":[
{
"key":"origin",
"label":"yyyyyyy yyyyy",
"value":"YYY"
},
{
"key":"destination",
"label":"xxxxxxxxxx",
"value":"XXX"
}
],
"secondaryFields":[
{
"key":"passenger-name",
"label":"Name",
"value":"xxxx xxxx"
}
],
"auxiliaryFields":[
{
"key":"flight",
"label":"Flight",
"value":"XXXXXX"
},
{
"key":"date",
"label":"Date",
"value":"12Jul"
},
{
"key":"boarding-time",
"label":"Boarding",
"value":"15:00"
}
],
"backFields":[
{
"key":"terms",
"value":"xxxxx xxxxxxxxx xxxxx xxxx"
}
],
"transitType":"PKTransitTypeAir"
},
"barcode":{
...
},
"ignoresTimeZone":true
}
It's the same/similar problem like this here https://discussions.apple.com/thread/4529193:
The expected result is when the time at the reminder is exact the same as the boarding pass.
The Remeinder should always remind me with the right time (time which is also on the boarding pass) no matter in which time zone I am at the moment.
many thanks for Your help. You are my last hope...
There is no Bug.
The problem was my system and the delivered data. The date for the reminder was always wrong (wrong time zone).
So if you have a similar problem, so check and validate your input first.

bitcoin transaction block height

Hi I check that in the blockchain.info or blockr.io or other block explorer when checking one transaction ( not my own wallet transaction ) I could see the return value of "block_height" which can be use to count the transaction confirmation using block_count - block_height.
I have my own bitcoin node with -txindex enabled and I add additional txindex=1 in the conf.
But when using "bitcoin-cli decoderawtransaction " the parameters was never there.
How do I turn on that ? Or is it a custom made code ?
Bitcoind run under Ubuntu 14.04 x64bit version 0.11.0
I disable the wallet function and install using https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md
The decoderawtransaction command just decodes the transaction, that is, it makes the transaction human readable.
Any other (though useful) information which is not related to the raw structure of a transaction is not shown.
If you need further info, you might use getrawtransaction <tx hash> 1, which returns both the result of decoderawtransaction and some additional info, such as:
bitcoin-cli getrawtransaction 6263f1db6112a21771bb44f242a282d04313bbda5ed8b517489bd51aa48f7367 1
-> {
"hex" : "010000000...0b00",
"txid" : "6263f1db6112a21771bb44f242a282d04313bbda5ed8b517489bd51aa48f7367",
"version" : 1,
"locktime" : 723863,
"vin" : [
{...}
],
"vout" : [
{...}
],
"blockhash" : "0000000084b830792477a0955eee8081e8074071930f7340ff600cc48c4f724f",
"confirmations" : 4,
"time" : 1457383001,
"blocktime" : 1457383001
}

Where to find embedded JS function for Neo4j traverse REST API

I am new to Neo4j, and I read the documentation for traverse part by REST, there is an example here:
http://neo4j.com/docs/milestone/rest-api-traverse.html#rest-api-traversal-using-a-return-filter
{
"order" : "breadth_first",
"return_filter" : {
"body" : "position.endNode().getProperty('name').toLowerCase().contains('t')",
"language" : "javascript"
},
Is anybody can tell me what I can find the information about position, endNode(),getProperty...., it likes an embedded javascript function, but i do not know the meaning of it.
Thanks.
To quote the Traversals documentation:
The position object in the body of the return_filter and
prune_evaluator is a Path object representing the path from the start
node to the current traversal position.
You can start with the JavaDoc for Path.endNode() to understand how to interpret the return_filter.
[ADDENDUM, to answer a comment]
If you want to filter the traversal by label, you can use Node.hasLabel(), like this:
"return_filter" : {
"body" : "position.endNode().hasLabel(DynamicLabel.label('t'))",
"language" : "javascript"
}

JSON: Providing Constant Values

Though I'm using iOS, I don't think that's relevant here.
I need to be able to use a constant in two of the values for JSON. Reason: We're using different servers for Development and Production, and can't have the development data mixed with production Data. At build time we'll provide values based on the environment settings (development / production).
Thus, how can I use a constant value for "rsids" and server" in the JSON below:
{
"version" : "1.0",
"analytics" : {
"rsids" : "//I would like to put a Constant Here",
"server" : "",
"charset" : "UTF-8",
"ssl" : false,
"offlineEnabled" : true,
"lifecycleTimeout" : 300,
"privacyDefault" : "optedin",
"poi" : []
},
"target" : {
"clientCode" : "",
"timeout" : 5
},
"audienceManager" : {
"server" : "//I would like to put a Constant Here"
}
}
I would like to be able to do something like this:
NSStirng const *kServerURL = #"www.google.com"
"audienceManager" : {
"server" : kServerUrl
}
UPDATE
There is no Dictionary. I'm using the iOS SDK by Adobe for Site Catalyst. They have a JSON file that I have to edit and provide RSID and Server values. The JSON that you see in the question is the entire file.
The SDK has a library file (.a) also. Here are the docs: http://microsite.omniture.com/t2/help/en_US/mobile/ios/index.html#ADBMobile_Class_and_Method_Reference
If you need to change the value of the constant at build time you should be using #if/#ifdef and friends to do so.
#ifdef DEBUG
NSString const *kServerURL = #"www.google.com"
#else
NSString const *kServerURL = #"www.bing.com"
#endif
You'll have to create multiple files then. You can't have a JSON file be dynamic.
When creating your files from code, you can use constants. At the top of your .m file before the #implementation portion, defined them on multiple lines. One for development, one for QA, and one for production. Comment out the two you don't want and leave the one you do want. When using it, use the format.
"server":[NSString stringWithFormat:#"\"%#\"",kServerUrl];
It is often a good idea to have a dummy login that can safely communicate with your servers. Such a login would have an example set of data to be read, and any uploads would be ignored. This is handy for testing between the different environments, including production, and allows any apps submitted to the App Store to be fully tested with a valid login.

Resources