how to use bitsharp library to get transaction from you wallet - bitsharp

I am doing some test with bitcoins. I download BitCoin-qt and create my wallet and my address for sending receiving bitcoin.
I am now trying to read the wallet I've created to send an email when a new payment is received.
I have come to the BitSharp library, but unfortunately I do not understand very much how to use it.
I mean as far as I have understood you could use a test network for your test but when I try to link to my wallet.dat file I get an error from the code and I cannot understand why.
My problem is that I need to understand how to code a software like this.
I have a wallet correctly set up I can see transactions send and receive.
How should I connect to it to see with and eventlistener if new transactions arrived in my wallet so to generate an alert?
Thanks in advance for the help
Paolo

You don't need to access wallet.dat file for this. Bitcoin-qt has some methods for this kind of events.
You need to change your bitcoin.conf file.
walletnotify=c:\walletnotify.bat %s
blocknotify=c:\blocknotify.bat %s
This methods calling when new transfer in your wallet or when new block has been found.

Related

How can I go about setting up push notifications using firebase cloud messaging and cloud functions?

I'm been coding for a year now and know swift really well and the basics to javascript. I've built a social media like app and its completely done besides the push notification functionality... which i've been struggling with for quite a while now.
I'm having trouble figuring out how to implement these in order to send notifications like when a user follows another user or they receive a new messege.
I don't understand how to integrate the cloud functions that I would write using and node.js with my xcode project.
When I look for documentation online its usually just how to send push notifications using the firebase notifications console which is cool but doesn't trigger based off specific user actions or events (ex: when the user gets a new follower)
I think since im struggling with grasping the concept of how to implement it, the actual technical set up of it makes even less sense. Any advice or resources would be greatly appreciated.
Thank you
Conceptually, what you have to do is set up server-side processing of your database to manage when events occur. This is what the Node.js code will be. Everything is connected through the database-- your Xcode and Node.js code work independently, but both communicate with Firebase. You can create a Cloud Function that will automatically run when it detects changes in your database, and this will automatically send push notifications.
I've done a similar project-- I set up a listener for my Realtime Database in my Cloud Function. Every time the user got a new follower, i.e. their followers tree was updated, I sent a notification to the device using an FCM token (which I also stored in the database).
exports.onTimeEnd = functions.database.ref("users/{user}/followers")
.onUpdate((snapshot, context) => {
// your code here
}
In that block, you can call a .once() to find out the user's token to send them a notification with.
https://firebase.google.com/docs/functions/get-started
This link here told me everything I had to do in regards to set up in the terminal. Super helpful.

Is it possible to send changeMessage notification at wallet creation?

I have a website with Symfony for create IOS wallet and i want to know if is it possible to send a changeMessage notification to my users when they install wallet on their phones like : Welcome on your wallet !
Is it possible ?
For informations, my changeMessage notification work when i update my user wallet, i create notification parameter to send a notification message with 255 characters Max and my changeMessage call this parameter when pass is update.
Thanks in advance
Yes, it is possible but it takes a bit of work.
When a user first installs your pass, iOS will call the web service to register. Once registered it will immediately make a call to get the latest version of the pass.
If the pass returned is different to the pass originally installed then the change message will trigger.
Since this will happen just once at the time the pass is installed, you should achieve the same experience you describe in your question.

iOS push notifications with Firebase FCM to a specific user

I am trying to send notifications to users when something happens in their account, for example a new friend request or follower, or a tag in an image. I have been looking into Firebase FCM to make this happen but can't figure out how to send push notifications to just 1 user, based on some activity in their account.
Is there any way this can be done in FCM or are there are any other methods out there to make this happen? I'm new to iOS dev and push notifications, so any help will be greatly appreciated!
Thanks!
PS: If I do need to make my own server for this, could someone point me to any resources to do this in python? I've seen quite a few posts for APNs servers in PHP, but I don't know PHP that well.
The easiest way is to use Firebase Cloud Functions , I have experience working with it using Javascript then trigger the function when something changes in database. You can also send a http request with the specific device token which you want a push notification to be delivered to, then the function will do it's magic for you. Firebase have ready to use samples from their Github repo.
NB: - For your case if you really want to use Python then check this answer it might help you get started.

Apple Passbook(Wallet) device Registration not by app

I'm trying to build up a web service to push discount information to end-users. My question is that I know we can push coupon by my own app but is there any possible way to avoid end-user installing our app? Is there any possible way that we only use web service to get device_library_identifier from our users to push notification to apple passbooks?
Very Thanks!
Pkpass files can be downloaded from web pages, attached to emails or loaded via QR code, for example. You don't need to use an app to deliver them.
When a .pkpass file is added to a user's wallet, it will register itself with your webService and you can then push updates to the pass.
This web service is outlined in Apple's documentation and covers what you need to record the pass:
https://developer.apple.com/library/ios/documentation/PassKit/Reference/PassKit_WebService/WebService.html
The section under "Update a Pass" in Apple's Wallet Overview, explains how this works in the context of a pass
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/PassKit_PG/Updating.html#//apple_ref/doc/uid/TP40012195-CH5-SW1
If normally you have new promotion to send coupon to customer time to time, you may start with member pass first so you can send link to download new coupon with notification to your member to load new coupon when they want without coming to your place to download new coupon.

Programmatically create pass for passkit on device?

I am trying to find a way to generate a pass for passkit on the device its self after it received the information to put in a pass over the network.
Does anyone know if this can be done / how to do this?
Refer to: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/PassKit_PG/YourFirst.html#//apple_ref/doc/uid/TP40012195-CH2-SW1
Basically: Not easily (if at all), you need to be able to sign your pass using signpass, a command line utility in order to make it readable by devices. This will cause a lot of hassle and distress, as you can't run another process on iOS, and to convert the signpass code to run on the device might not be possible either.
What I would suggest is to sign your pass on the server/wherever the data is coming from, and send both the information and the generated .pkpass to the device. This is how it was designed, and how it should be used. Read the docs for more information, they're very clear.
Actually, Apple have stated the security problems when signing passes in iOS. This is because the certificates needs to be packaged with the app. And you don't want to expose certificates to users like that.
Just like WDUK suggests, implement a simple pass signing and distribution server that your app can request passes from. This is also very helpful when you want to update passes added to devices.
I'm sure you can find a server implementation that fits your needs on GitHub.

Resources